[PATCH] SUNRPC: Fix possible autodisconnect during connect due to stale last_used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a connection is successful ensure last_used is updated before calling
xprt_schedule_autodisconnect inside xprt_unlock_connect.  This avoids a
possible xprt_autoclose firing immediately after connect sequence due to
an old value of last_used given to mod_timer in xprt_schedule_autodisconnect.

Signed-off-by: Dave Wysochanski <dwysocha@xxxxxxxxxx>
---
 net/sunrpc/xprt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index f6c82b1..fceaede 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -800,6 +800,7 @@ void xprt_unlock_connect(struct rpc_xprt *xprt, void *cookie)
 		goto out;
 	xprt->snd_task =NULL;
 	xprt->ops->release_xprt(xprt, NULL);
+	xprt->last_used = jiffies;
 	xprt_schedule_autodisconnect(xprt);
 out:
 	spin_unlock_bh(&xprt->transport_lock);
-- 
1.8.3.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux