summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorNeilBrown2006-10-04 11:15:44 +0200
committerLinus Torvalds2006-10-04 16:55:15 +0200
commit37a034729ae611295bbb8e925333d4d54d7c1ebc (patch)
tree219882844fd21fc65eb8673677e7d37a1ff463a2 /net/sunrpc
parent[PATCH] knfsd: nfsd: lockdep annotation fix (diff)
downloadkernel-qcow2-linux-37a034729ae611295bbb8e925333d4d54d7c1ebc.tar.gz
kernel-qcow2-linux-37a034729ae611295bbb8e925333d4d54d7c1ebc.tar.xz
kernel-qcow2-linux-37a034729ae611295bbb8e925333d4d54d7c1ebc.zip
[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>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/svcsock.c2
1 files changed, 2 insertions, 0 deletions
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)
spin_unlock(&serv->sv_lock);
if (closesk)
svc_delete_socket(closesk);
+ else if (toclose)
+ return -ENOENT;
return len;
}
EXPORT_SYMBOL(svc_sock_names);