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:56:47 +0000 (09:56 +0200)
commit0f4308a164a9de4ffaf86b22082dbdfa16bdc601
tree9956b3951519c57f817297f95a308fd1da8dc841
parent546c04c857912a60b0724a29315845b1e2379c90
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