]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Fix disconnection races
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 17 Dec 2018 18:34:59 +0000 (13:34 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 18 Dec 2018 16:03:57 +0000 (11:03 -0500)
commit2539499e6f58cc2ff0229ea28e6ae958b6bd72e4
tree23b94aa7599440d464970fe1cd85689446b84580
parentcdabd85799ad6fbcc9b19037eea605d7b7de6d15
SUNRPC: Fix disconnection races

When the socket is closed, we need to call xprt_disconnect_done() in order
to clean up the XPRT_WRITE_SPACE flag, and wake up the sleeping tasks.

However, we also want to ensure that we don't wake them up before the socket
is closed, since that would cause thundering herd issues with everyone
piling up to retransmit before the TCP shutdown dance has completed.
Only the task that holds XPRT_LOCKED needs to wake up early in order to
allow the close to complete.

Reported-by: Dave Wysochanski <dwysocha@redhat.com>
Reported-by: Scott Mayhew <smayhew@redhat.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/clnt.c
net/sunrpc/xprt.c
net/sunrpc/xprtsock.c