]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Ensure that we wait for connections to complete before retrying
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 17 Sep 2015 03:43:17 +0000 (23:43 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 17 Sep 2015 22:01:28 +0000 (18:01 -0400)
commit644d03803fc9dba895eb81e9990a071a8b37bc0e
tree5bc1719c4ba7a0d2cd7e79b07de7d5c0800a99a5
parenta6bac1f26dbb6689b508ac510b8d973bc10345ea
SUNRPC: Ensure that we wait for connections to complete before retrying

Commit 4b3213cafd85, moved the responsibility for unlocking the socket to
xs_tcp_setup_socket, meaning that the socket will be unlocked before we
know that it has finished trying to connect. The following patch is based on
an initial patch by Russell King to ensure that we delay clearing the
XPRT_CONNECTING flag until we either know that we failed to initiate
a connection attempt, or the connection attempt itself failed.

Fixes: 4b3213cafd85 ("SUNRPC: Add helpers to prevent socket create from racing")
Reported-by: Russell King <linux@arm.linux.org.uk>
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
include/linux/sunrpc/xprtsock.h
net/sunrpc/xprtsock.c