SUNRPC: Prevent races in xs_abort_connection()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 23 Oct 2012 21:50:07 +0000 (17:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Oct 2012 16:51:34 +0000 (09:51 -0700)
commit910e425b29da7b601a99f49e81da666ab8ed5920
treec98b00dcaa20d838361c297aa1a6b58b7ccc59e1
parent16b7109680b1a0c8b3ea6271645c5853f0ffaa3f
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprtsock.c