summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r--fs/nfsd/nfsctl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index caf4fdc674c..e051847b93f 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -939,17 +939,18 @@ static ssize_t __write_ports_addfd(char *buf)
if (err != 0)
return err;
- err = svc_addsock(nfsd_serv, fd, buf);
- if (err >= 0) {
- err = lockd_up();
- if (err < 0)
- svc_sock_names(buf + strlen(buf) + 1, nfsd_serv, buf);
+ err = lockd_up();
+ if (err != 0)
+ goto out;
- /* Decrease the count, but don't shut down the service */
- nfsd_serv->sv_nrthreads--;
- }
+ err = svc_addsock(nfsd_serv, fd, buf);
+ if (err < 0)
+ lockd_down();
- return err < 0 ? err : 0;
+out:
+ /* Decrease the count, but don't shut down the service */
+ nfsd_serv->sv_nrthreads--;
+ return err;
}
/*