* Patch "net/sunrpc/xprt_sock: fix regression in connection error reporting." has been added to the 4.12-stable tree
@ 2017-07-25 4:39 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-25 4:39 UTC (permalink / raw)
To: neilb, Anna.Schumaker, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
net/sunrpc/xprt_sock: fix regression in connection error reporting.
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-sunrpc-xprt_sock-fix-regression-in-connection-error-reporting.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 3ffbc1d65583394be12801655781dd2b079ce169 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Wed, 19 Jul 2017 14:05:01 +1000
Subject: net/sunrpc/xprt_sock: fix regression in connection error reporting.
From: NeilBrown <neilb@suse.com>
commit 3ffbc1d65583394be12801655781dd2b079ce169 upstream.
Commit 3d4762639dd3 ("tcp: remove poll() flakes when receiving
RST") in v4.12 changed the order in which ->sk_state_change()
and ->sk_error_report() are called when a socket is shut
down - sk_state_change() is now called first.
This causes xs_tcp_state_change() -> xs_sock_mark_closed() ->
xprt_disconnect_done() to wake all pending tasked with -EAGAIN.
When the ->sk_error_report() callback arrives, it is too late to
pass the error on, and it is lost.
As easy way to demonstrate the problem caused is to try to start
rpc.nfsd while rcpbind isn't running.
nfsd will attempt a tcp connection to rpcbind. A ECONNREFUSED
error is returned, but sunrpc code loses the error and keeps
retrying. If it saw the ECONNREFUSED, it would abort.
To fix this, handle the sk->sk_err in the TCP_CLOSE branch of
xs_tcp_state_change().
Fixes: 3d4762639dd3 ("tcp: remove poll() flakes when receiving RST")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sunrpc/xprtsock.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1624,6 +1624,8 @@ static void xs_tcp_state_change(struct s
if (test_and_clear_bit(XPRT_SOCK_CONNECTING,
&transport->sock_state))
xprt_clear_connecting(xprt);
+ if (sk->sk_err)
+ xprt_wake_pending_tasks(xprt, -sk->sk_err);
xs_sock_mark_closed(xprt);
}
out:
Patches currently in stable-queue which might be from neilb@suse.com are
queue-4.12/nfs-only-invalidate-dentrys-that-are-clearly-invalid.patch
queue-4.12/md-don-t-use-flush_signals-in-userspace-processes.patch
queue-4.12/md-fix-deadlock-between-mddev_suspend-and-md_write_start.patch
queue-4.12/net-sunrpc-xprt_sock-fix-regression-in-connection-error-reporting.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-25 4:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 4:39 Patch "net/sunrpc/xprt_sock: fix regression in connection error reporting." has been added to the 4.12-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).