linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSD: Keep existing listners on portlist error
@ 2021-10-06 14:18 Benjamin Coddington
  2021-10-06 14:22 ` Benjamin Coddington
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Benjamin Coddington @ 2021-10-06 14:18 UTC (permalink / raw)
  To: bfields, chuck.lever; +Cc: linux-nfs

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 callingn nfsd_destroy().

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
 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 c2c3d9077dc5..df4613a4924c 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -793,7 +793,10 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr
 		svc_xprt_put(xprt);
 	}
 out_err:
-	nfsd_destroy(net);
+	if (list_empty(&nn->nfsd_serv->sv_permsocks))
+		nfsd_destroy(net);
+	else
+		nn->nfsd_serv->sv_nrthreads--;
 	return err;
 }
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-06 17:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-06 14:18 [PATCH] NFSD: Keep existing listners on portlist error Benjamin Coddington
2021-10-06 14:22 ` Benjamin Coddington
2021-10-06 14:22 ` Chuck Lever III
2021-10-06 14:33 ` J. Bruce Fields
2021-10-06 14:43   ` Benjamin Coddington
2021-10-06 14:46     ` J. Bruce Fields
2021-10-06 17:16 ` Benjamin Coddington
2021-10-06 17:20 ` [PATCH v2] NFSD: Keep existing listeners " Benjamin Coddington
2021-10-06 17:27   ` Chuck Lever III

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).