]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:26:10 +0000 (19:26 +0200)
commit77bb3c931d577185760c59428a87e8966a126b0b
treef72c3813fd93065620bc21fd8b8fbc30a9ff65e0
parentf160db25e9c4baa65871f4f7972064f1d7ecb160
SUNRPC: Ensure that we wait for connections to complete before retrying

commit 0fdea1e8a2853f79d39b8555cc9de16a7e0ab26f upstream.

Commit 718ba5b87343, 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: 718ba5b87343 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/sunrpc/xprtsock.h
net/sunrpc/xprtsock.c