From: Sasha Levin Date: Wed, 20 Oct 2021 21:21:34 +0000 (-0400) Subject: Fixes for 4.4 X-Git-Tag: v4.4.290~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74c4a65320543b569763e00bf0a4b784f89efba9;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.4 Signed-off-by: Sasha Levin --- 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 index 00000000000..780e570ccc4 --- /dev/null +++ b/queue-4.4/nfsd-keep-existing-listeners-on-portlist-error.patch @@ -0,0 +1,42 @@ +From adde9111d8f992452c2389f2c31f71fe3f892ae3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Oct 2021 13:20:44 -0400 +Subject: NFSD: Keep existing listeners on portlist error + +From: Benjamin Coddington + +[ 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 +Signed-off-by: Chuck Lever +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-4.4/series b/queue-4.4/series index 71ebf788512..ec8c9a21d8f 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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