diff options
-rw-r--r-- | fs/nfsd/nfsctl.c | 12 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index f85472dda463..6c2ddfed2cfc 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -523,11 +523,11 @@ static ssize_t write_ports(struct file *file, char *buf, size_t size) | |||
523 | err = nfsd_create_serv(); | 523 | err = nfsd_create_serv(); |
524 | if (!err) { | 524 | if (!err) { |
525 | int proto = 0; | 525 | int proto = 0; |
526 | err = lockd_up(proto); | 526 | err = svc_addsock(nfsd_serv, fd, buf, &proto); |
527 | if (!err) { | 527 | if (err >= 0) { |
528 | err = svc_addsock(nfsd_serv, fd, buf, &proto); | 528 | err = lockd_up(proto); |
529 | if (err) | 529 | if (err < 0) |
530 | lockd_down(); | 530 | svc_sock_names(buf+strlen(buf)+1, nfsd_serv, buf); |
531 | } | 531 | } |
532 | /* Decrease the count, but don't shutdown the | 532 | /* Decrease the count, but don't shutdown the |
533 | * the service | 533 | * the service |
@@ -536,7 +536,7 @@ static ssize_t write_ports(struct file *file, char *buf, size_t size) | |||
536 | nfsd_serv->sv_nrthreads--; | 536 | nfsd_serv->sv_nrthreads--; |
537 | unlock_kernel(); | 537 | unlock_kernel(); |
538 | } | 538 | } |
539 | return err; | 539 | return err < 0 ? err : 0; |
540 | } | 540 | } |
541 | if (buf[0] == '-') { | 541 | if (buf[0] == '-') { |
542 | char *toclose = kstrdup(buf+1, GFP_KERNEL); | 542 | char *toclose = kstrdup(buf+1, GFP_KERNEL); |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 4e0813b12ccf..4de8626e4f54 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -492,6 +492,9 @@ svc_sock_names(char *buf, struct svc_serv *serv, char *toclose) | |||
492 | } | 492 | } |
493 | spin_unlock(&serv->sv_lock); | 493 | spin_unlock(&serv->sv_lock); |
494 | if (closesk) | 494 | if (closesk) |
495 | /* Should unregister with portmap, but you cannot | ||
496 | * unregister just one protocol... | ||
497 | */ | ||
495 | svc_delete_socket(closesk); | 498 | svc_delete_socket(closesk); |
496 | else if (toclose) | 499 | else if (toclose) |
497 | return -ENOENT; | 500 | return -ENOENT; |