diff options
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 508941c23af7..b53b1d042f1f 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -949,15 +949,12 @@ static ssize_t __write_ports_addfd(char *buf) | |||
949 | if (err != 0) | 949 | if (err != 0) |
950 | return err; | 950 | return err; |
951 | 951 | ||
952 | err = lockd_up(); | ||
953 | if (err != 0) | ||
954 | goto out; | ||
955 | |||
956 | err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT); | 952 | err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT); |
957 | if (err < 0) | 953 | if (err < 0) { |
958 | lockd_down(); | 954 | svc_destroy(nfsd_serv); |
955 | return err; | ||
956 | } | ||
959 | 957 | ||
960 | out: | ||
961 | /* Decrease the count, but don't shut down the service */ | 958 | /* Decrease the count, but don't shut down the service */ |
962 | nfsd_serv->sv_nrthreads--; | 959 | nfsd_serv->sv_nrthreads--; |
963 | return err; | 960 | return err; |
@@ -978,9 +975,6 @@ static ssize_t __write_ports_delfd(char *buf) | |||
978 | if (nfsd_serv != NULL) | 975 | if (nfsd_serv != NULL) |
979 | len = svc_sock_names(nfsd_serv, buf, | 976 | len = svc_sock_names(nfsd_serv, buf, |
980 | SIMPLE_TRANSACTION_LIMIT, toclose); | 977 | SIMPLE_TRANSACTION_LIMIT, toclose); |
981 | if (len >= 0) | ||
982 | lockd_down(); | ||
983 | |||
984 | kfree(toclose); | 978 | kfree(toclose); |
985 | return len; | 979 | return len; |
986 | } | 980 | } |
@@ -1014,6 +1008,9 @@ static ssize_t __write_ports_addxprt(char *buf) | |||
1014 | PF_INET6, port, SVC_SOCK_ANONYMOUS); | 1008 | PF_INET6, port, SVC_SOCK_ANONYMOUS); |
1015 | if (err < 0 && err != -EAFNOSUPPORT) | 1009 | if (err < 0 && err != -EAFNOSUPPORT) |
1016 | goto out_close; | 1010 | goto out_close; |
1011 | |||
1012 | /* Decrease the count, but don't shut down the service */ | ||
1013 | nfsd_serv->sv_nrthreads--; | ||
1017 | return 0; | 1014 | return 0; |
1018 | out_close: | 1015 | out_close: |
1019 | xprt = svc_find_xprt(nfsd_serv, transport, PF_INET, port); | 1016 | xprt = svc_find_xprt(nfsd_serv, transport, PF_INET, port); |
@@ -1022,8 +1019,7 @@ out_close: | |||
1022 | svc_xprt_put(xprt); | 1019 | svc_xprt_put(xprt); |
1023 | } | 1020 | } |
1024 | out_err: | 1021 | out_err: |
1025 | /* Decrease the count, but don't shut down the service */ | 1022 | svc_destroy(nfsd_serv); |
1026 | nfsd_serv->sv_nrthreads--; | ||
1027 | return err; | 1023 | return err; |
1028 | } | 1024 | } |
1029 | 1025 | ||
@@ -1194,7 +1190,7 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size) | |||
1194 | bsize = NFSSVC_MAXBLKSIZE; | 1190 | bsize = NFSSVC_MAXBLKSIZE; |
1195 | bsize &= ~(1024-1); | 1191 | bsize &= ~(1024-1); |
1196 | mutex_lock(&nfsd_mutex); | 1192 | mutex_lock(&nfsd_mutex); |
1197 | if (nfsd_serv && nfsd_serv->sv_nrthreads) { | 1193 | if (nfsd_serv) { |
1198 | mutex_unlock(&nfsd_mutex); | 1194 | mutex_unlock(&nfsd_mutex); |
1199 | return -EBUSY; | 1195 | return -EBUSY; |
1200 | } | 1196 | } |
@@ -1310,6 +1306,8 @@ static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size) | |||
1310 | return -EINVAL; | 1306 | return -EINVAL; |
1311 | 1307 | ||
1312 | status = nfs4_reset_recoverydir(recdir); | 1308 | status = nfs4_reset_recoverydir(recdir); |
1309 | if (status) | ||
1310 | return status; | ||
1313 | } | 1311 | } |
1314 | 1312 | ||
1315 | return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%s\n", | 1313 | return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%s\n", |