]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.4
authorSasha Levin <sashal@kernel.org>
Wed, 20 Oct 2021 21:21:34 +0000 (17:21 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 20 Oct 2021 21:21:34 +0000 (17:21 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.4/nfsd-keep-existing-listeners-on-portlist-error.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/nfsd-keep-existing-listeners-on-portlist-error.patch b/queue-4.4/nfsd-keep-existing-listeners-on-portlist-error.patch
new file mode 100644 (file)
index 0000000..780e570
--- /dev/null
@@ -0,0 +1,42 @@
+From adde9111d8f992452c2389f2c31f71fe3f892ae3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 6 Oct 2021 13:20:44 -0400
+Subject: NFSD: Keep existing listeners on portlist error
+
+From: Benjamin Coddington <bcodding@redhat.com>
+
+[ Upstream commit c20106944eb679fa3ab7e686fe5f6ba30fbc51e5 ]
+
+If nfsd has existing listening sockets without any processes, then an error
+returned from svc_create_xprt() for an additional transport will remove
+those existing listeners.  We're seeing this in practice when userspace
+attempts to create rpcrdma transports without having the rpcrdma modules
+present before creating nfsd kernel processes.  Fix this by checking for
+existing sockets before calling nfsd_destroy().
+
+Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfsd/nfsctl.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
+index 0cd57db5c5af..dfd1949b31ea 100644
+--- a/fs/nfsd/nfsctl.c
++++ b/fs/nfsd/nfsctl.c
+@@ -768,7 +768,10 @@ out_close:
+               svc_xprt_put(xprt);
+       }
+ out_err:
+-      nfsd_destroy(net);
++      if (!list_empty(&nn->nfsd_serv->sv_permsocks))
++              nn->nfsd_serv->sv_nrthreads--;
++       else
++              nfsd_destroy(net);
+       return err;
+ }
+-- 
+2.33.0
+
index 71ebf788512a175a0e4e9963ac705679aeab44df..ec8c9a21d8f4808ab0c1cfba6e15cfcf8955063a 100644 (file)
@@ -20,3 +20,4 @@ nfc-digital-fix-possible-memory-leak-in-digital_in_send_sdd_req.patch
 pata_legacy-fix-a-couple-uninitialized-variable-bugs.patch
 drm-msm-fix-null-pointer-dereference-on-pointer-edp.patch
 r8152-select-crc32-and-crypto-crypto_hash-crypto_sha256.patch
+nfsd-keep-existing-listeners-on-portlist-error.patch