SUNRPC: Fix races in xs_nospace()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 11 Feb 2014 14:15:54 +0000 (09:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 05:30:08 +0000 (21:30 -0800)
commit830d5bd83a895818388f874675d3bd76dc470e01
tree362e1cb333d48a211da3492c7dab71b88e47ea20
parent6319b13bb7e47c75e00cb6a5cabfb448983dc233
SUNRPC: Fix races in xs_nospace()

commit 06ea0bfe6e6043cb56a78935a19f6f8ebc636226 upstream.

When a send failure occurs due to the socket being out of buffer space,
we call xs_nospace() in order to have the RPC task wait until the
socket has drained enough to make it worth while trying again.
The current patch fixes a race in which the socket is drained before
we get round to setting up the machinery in xs_nospace(), and which
is reported to cause hangs.

Link: http://lkml.kernel.org/r/20140210170315.33dfc621@notabene.brown
Fixes: a9a6b52ee1ba (SUNRPC: Don't start the retransmission timer...)
Reported-by: Neil Brown <neilb@suse.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprtsock.c