]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 11:34:15 +0000 (12:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 11:34:15 +0000 (12:34 +0100)
added patches:
sunrpc-econnrefused-should-cause-a-rebind.patch

queue-4.9/sunrpc-econnrefused-should-cause-a-rebind.patch [new file with mode: 0644]

diff --git a/queue-4.9/sunrpc-econnrefused-should-cause-a-rebind.patch b/queue-4.9/sunrpc-econnrefused-should-cause-a-rebind.patch
new file mode 100644 (file)
index 0000000..ee3c47c
--- /dev/null
@@ -0,0 +1,52 @@
+From fd01b2597941d9c17980222999b0721648b383b8 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.com>
+Date: Fri, 18 Aug 2017 17:12:51 +1000
+Subject: SUNRPC: ECONNREFUSED should cause a rebind.
+
+From: NeilBrown <neilb@suse.com>
+
+commit fd01b2597941d9c17980222999b0721648b383b8 upstream.
+
+If you
+ - mount and NFSv3 filesystem
+ - do some file locking which requires the server
+   to make a GRANT call back
+ - unmount
+ - mount again and do the same locking
+
+then the second attempt at locking suffers a 30 second delay.
+Unmounting and remounting causes lockd to stop and restart,
+which causes it to bind to a new port.
+The server still thinks the old port is valid and gets ECONNREFUSED
+when trying to contact it.
+ECONNREFUSED should be seen as a hard error that is not worth
+retrying.  Rebinding is the only reasonable response.
+
+This patch forces a rebind if that makes sense.
+
+Signed-off-by: NeilBrown <neilb@suse.com>
+Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
+Cc: Calum Mackay <calum.mackay@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/sunrpc/clnt.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/net/sunrpc/clnt.c
++++ b/net/sunrpc/clnt.c
+@@ -1936,6 +1936,14 @@ call_connect_status(struct rpc_task *tas
+       task->tk_status = 0;
+       switch (status) {
+       case -ECONNREFUSED:
++              /* A positive refusal suggests a rebind is needed. */
++              if (RPC_IS_SOFTCONN(task))
++                      break;
++              if (clnt->cl_autobind) {
++                      rpc_force_rebind(clnt);
++                      task->tk_action = call_bind;
++                      return;
++              }
+       case -ECONNRESET:
+       case -ECONNABORTED:
+       case -ENETUNREACH: