aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNeilBrown2021-11-29 15:51:25 +1100
committerChuck Lever2021-12-13 13:42:49 -0500
commit89b24336f03a8ba560e96b0c47a8434a7fa48e3c (patch)
tree10fc182348b0d0be1e793704a44557f30f4dd4ce /fs
parentc2f1c4bd20621175c581f298b4943df0cffbd841 (diff)
NFSD: handle errors better in write_ports_addfd()
If write_ports_add() fails, we shouldn't destroy the serv, unless we had only just created it. So if there are any permanent sockets already attached, leave the serv in place. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfsctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 51a49e0cfe37..bf4c9996ad92 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -742,7 +742,7 @@ static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred
return err;
err = svc_addsock(nn->nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
- if (err < 0) {
+ if (err < 0 && list_empty(&nn->nfsd_serv->sv_permsocks)) {
nfsd_destroy(net);
return err;
}