diff options
author | NeilBrown <neilb@suse.de> | 2006-10-04 05:15:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:15 -0400 |
commit | 37a034729ae611295bbb8e925333d4d54d7c1ebc (patch) | |
tree | 219882844fd21fc65eb8673677e7d37a1ff463a2 | |
parent | 7ed94296a660a61989b5d54f0c4bb804f30567d3 (diff) |
[PATCH] knfsd: call lockd_down when closing a socket via a write to nfsd/portlist
The refcount that nfsd holds on lockd is based on the number of open sockets.
So when we close a socket, we should decrement the ref (with lockd_down).
Currently when a socket is closed via writing to the portlist file, that
doesn't happen.
So: make sure we get an error return if the socket that was requested does is
not found, and call lockd_down if it was.
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/nfsd/nfsctl.c | 2 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 5c6a477c20ec..83997282fc1a 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -545,6 +545,8 @@ static ssize_t write_ports(struct file *file, char *buf, size_t size) | |||
545 | if (nfsd_serv) | 545 | if (nfsd_serv) |
546 | len = svc_sock_names(buf, nfsd_serv, toclose); | 546 | len = svc_sock_names(buf, nfsd_serv, toclose); |
547 | unlock_kernel(); | 547 | unlock_kernel(); |
548 | if (len >= 0) | ||
549 | lockd_down(); | ||
548 | kfree(toclose); | 550 | kfree(toclose); |
549 | return len; | 551 | return len; |
550 | } | 552 | } |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index cba85d195222..4e0813b12ccf 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -493,6 +493,8 @@ svc_sock_names(char *buf, struct svc_serv *serv, char *toclose) | |||
493 | spin_unlock(&serv->sv_lock); | 493 | spin_unlock(&serv->sv_lock); |
494 | if (closesk) | 494 | if (closesk) |
495 | svc_delete_socket(closesk); | 495 | svc_delete_socket(closesk); |
496 | else if (toclose) | ||
497 | return -ENOENT; | ||
496 | return len; | 498 | return len; |
497 | } | 499 | } |
498 | EXPORT_SYMBOL(svc_sock_names); | 500 | EXPORT_SYMBOL(svc_sock_names); |