NFSD: Keep existing listeners on portlist error
authorBenjamin Coddington <bcodding@redhat.com>
Wed, 6 Oct 2021 17:20:44 +0000 (13:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Oct 2021 07:51:39 +0000 (09:51 +0200)
commit652da40a9222e902bf46d21c144f62af8e8a8eeb
treeb20af3638e4dc6d63b22d7edd519b754ab6c8217
parentf0f25ea87b15b36943b6644c6c0d17168e3d8002
NFSD: Keep existing listeners on portlist error

[ 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