Skip to content

Commit c201069

Browse files
bcodding-rhchucklever
authored andcommitted
NFSD: Keep existing listeners on portlist error
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>
1 parent 2ba5acf commit c201069

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/nfsd/nfsctl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,10 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr
793793
svc_xprt_put(xprt);
794794
}
795795
out_err:
796-
nfsd_destroy(net);
796+
if (!list_empty(&nn->nfsd_serv->sv_permsocks))
797+
nn->nfsd_serv->sv_nrthreads--;
798+
else
799+
nfsd_destroy(net);
797800
return err;
798801
}
799802

0 commit comments

Comments
 (0)