SUNRPC: Prevent races in xs_abort_connection()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 23 Oct 2012 21:50:07 +0000 (17:50 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 30 Oct 2012 23:26:57 +0000 (23:26 +0000)
commitd5b39621940bd5cf4acf43116af84281b4c3238e
treeae6190ed4a6a12b3d3374067c0552e6f1f7a38cf
parentb6181a66e2678087ce98dd47554bd4a3ce54788d
SUNRPC: Prevent races in xs_abort_connection()

commit 4bc1e68ed6a8b59be8a79eb719be515a55c7bc68 upstream.

The call to xprt_disconnect_done() that is triggered by a successful
connection reset will trigger another automatic wakeup of all tasks
on the xprt->pending rpc_wait_queue. In particular it will cause an
early wake up of the task that called xprt_connect().

All we really want to do here is clear all the socket-specific state
flags, so we split that functionality out of xs_sock_mark_closed()
into a helper that can be called by xs_abort_connection()

Reported-by: Chris Perl <chris.perl@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: Chris Perl <chris.perl@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/sunrpc/xprtsock.c