]> git.itanic.dy.fi Git - linux-stable/commit
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:33:59 +0000 (09:33 +0200)
commitcdf486aa6a2add843b805672e5af4062ff9e90a4
tree11f13afc71fe55e336d344d6022931b19bdda166
parentf40e21ef9da3ca9b75a37feac3ffa2125813a268
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