SUNRPC: Fix a race in xs_tcp_state_change()
When scheduling the autoclose RPC call, we want to ensure that we don't race against the test_bit() call in xprt_clear_locked(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
@@ -1122,10 +1122,7 @@ static void xs_tcp_state_change(struct sock *sk)
|
||||
case TCP_SYN_RECV:
|
||||
break;
|
||||
case TCP_CLOSE_WAIT:
|
||||
/* Try to schedule an autoclose RPC calls */
|
||||
set_bit(XPRT_CLOSE_WAIT, &xprt->state);
|
||||
if (test_and_set_bit(XPRT_LOCKED, &xprt->state) == 0)
|
||||
queue_work(rpciod_workqueue, &xprt->task_cleanup);
|
||||
xprt_force_disconnect(xprt);
|
||||
default:
|
||||
xprt_disconnect(xprt);
|
||||
}
|
||||
|
Reference in New Issue
Block a user