diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-10-25 18:50:15 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-11-20 00:35:11 +0100 |
commit | 62bac4af3d778f6d06d351c0442008967c512588 (patch) | |
tree | b1e0b336d0f23f11896d81e48f2e8f66c2d8f75d /net/sunrpc/svc_xprt.c | |
parent | nfsd: fix NULL dereference in setattr() (diff) | |
download | linux-62bac4af3d778f6d06d351c0442008967c512588.tar.xz linux-62bac4af3d778f6d06d351c0442008967c512588.zip |
svcrpc: don't set then immediately clear XPT_DEFERRED
There's no harm to doing this, since the only caller will immediately
call svc_enqueue() afterwards, ensuring we don't miss the remaining
deferred requests just because XPT_DEFERRED was briefly cleared.
But why not just do this the simple way?
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index c82fe739fbdc..a74cb67f15bf 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -1059,14 +1059,13 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt) if (!test_bit(XPT_DEFERRED, &xprt->xpt_flags)) return NULL; spin_lock(&xprt->xpt_lock); - clear_bit(XPT_DEFERRED, &xprt->xpt_flags); if (!list_empty(&xprt->xpt_deferred)) { dr = list_entry(xprt->xpt_deferred.next, struct svc_deferred_req, handle.recent); list_del_init(&dr->handle.recent); - set_bit(XPT_DEFERRED, &xprt->xpt_flags); - } + } else + clear_bit(XPT_DEFERRED, &xprt->xpt_flags); spin_unlock(&xprt->xpt_lock); return dr; } |