diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2019-06-26 22:30:24 +0200 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-07-06 20:54:53 +0200 |
commit | 80d3c45fd765fbf4f10981b60ff6b1384bdbc706 (patch) | |
tree | 492ae6a591e1f276e6b5acb599f921ae8bac4a20 /net/sunrpc/xprt.c | |
parent | SUNRPC: Drop redundant CONFIG_ from CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES (diff) | |
download | linux-80d3c45fd765fbf4f10981b60ff6b1384bdbc706.tar.xz linux-80d3c45fd765fbf4f10981b60ff6b1384bdbc706.zip |
SUNRPC: Fix possible autodisconnect during connect due to old last_used
Ensure last_used is updated before calling mod_timer inside
xprt_schedule_autodisconnect. This avoids a possible xprt_autoclose
firing immediately after a successful connect when xprt_unlock_connect
calls xprt_schedule_autodisconnect with an old value of last_used.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index c4d138202abb..70d6a1f10db9 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -750,6 +750,7 @@ static void xprt_schedule_autodisconnect(struct rpc_xprt *xprt) __must_hold(&xprt->transport_lock) { + xprt->last_used = jiffies; if (RB_EMPTY_ROOT(&xprt->recv_queue) && xprt_has_timer(xprt)) mod_timer(&xprt->timer, xprt->last_used + xprt->idle_timeout); } @@ -1765,7 +1766,6 @@ void xprt_release(struct rpc_task *task) xprt->ops->release_xprt(xprt, task); if (xprt->ops->release_request) xprt->ops->release_request(task); - xprt->last_used = jiffies; xprt_schedule_autodisconnect(xprt); spin_unlock(&xprt->transport_lock); if (req->rq_buffer) |