aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-10-02 05:17:45 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-02 10:57:17 -0400
commit24e36663c375df577d2dcae437713481ffd6850c (patch)
treedd738e582b663c433eef3a53eb593a518439a285 /fs/nfs/client.c
parentbc591ccff27e6a85d3a0d6fcb16cfadcc45267a8 (diff)
[PATCH] knfsd: be more selective in which sockets lockd listens on
Currently lockd listens on UDP always, and TCP if CONFIG_NFSD_TCP is set. However as lockd performs services of the client as well, this is a problem. If CONFIG_NfSD_TCP is not set, and a tcp mount is used, the server will not be able to call back to lockd. So: - add an option to lockd_up saying which protocol is needed - Always open sockets for which an explicit port was given, otherwise only open a socket of the type required - Change nfsd to do one lockd_up per socket rather than one per thread. This - removes the dependancy on CONFIG_NFSD_TCP - means that lockd may open sockets other than at startup - means that lockd will *not* listen on UDP if the only mounts are TCP mount (and nfsd hasn't started). The latter is the only one that concerns me at all - I don't know if this might be a problem with some servers. 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 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index ec1938d4b814..8106f3b29e4a 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -460,7 +460,8 @@ static int nfs_start_lockd(struct nfs_server *server)
460 goto out; 460 goto out;
461 if (server->flags & NFS_MOUNT_NONLM) 461 if (server->flags & NFS_MOUNT_NONLM)
462 goto out; 462 goto out;
463 error = lockd_up(); 463 error = lockd_up((server->flags & NFS_MOUNT_TCP) ?
464 IPPROTO_TCP : IPPROTO_UDP);
464 if (error < 0) 465 if (error < 0)
465 server->flags |= NFS_MOUNT_NONLM; 466 server->flags |= NFS_MOUNT_NONLM;
466 else 467 else