diff options
author | Olaf Kirch | 2006-10-04 11:16:01 +0200 |
---|---|---|
committer | Linus Torvalds | 2006-10-04 16:55:17 +0200 |
commit | abd1f50094cad9dff6d68ada98b495549f52fc30 (patch) | |
tree | dd738067aa90af1cb4613a7c711ee426ff5f8ae9 /fs/lockd/host.c | |
parent | [PATCH] knfsd: simplify nlmsvc_invalidate_all (diff) | |
download | kernel-qcow2-linux-abd1f50094cad9dff6d68ada98b495549f52fc30.tar.gz kernel-qcow2-linux-abd1f50094cad9dff6d68ada98b495549f52fc30.tar.xz kernel-qcow2-linux-abd1f50094cad9dff6d68ada98b495549f52fc30.zip |
[PATCH] knfsd: lockd: optionally use hostnames for identifying peers
This patch adds the nsm_use_hostnames sysctl and module param. If set, lockd
will use the client's name (as given in the NLM arguments) to find the NSM
handle. This makes recovery work when the NFS peer is multi-homed, and the
reboot notification arrives from a different IP than the original lock calls.
Signed-off-by: Olaf Kirch <okir@suse.de>
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/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 1bf384307d15..a1423c66df04 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -462,7 +462,11 @@ __nsm_find(const struct sockaddr_in *sin, list_for_each(pos, &nsm_handles) { nsm = list_entry(pos, struct nsm_handle, sm_link); - if (!nlm_cmp_addr(&nsm->sm_addr, sin)) + if (hostname && nsm_use_hostnames) { + if (strlen(nsm->sm_name) != hostname_len + || memcmp(nsm->sm_name, hostname, hostname_len)) + continue; + } else if (!nlm_cmp_addr(&nsm->sm_addr, sin)) continue; atomic_inc(&nsm->sm_count); goto out; |