[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>
This commit is contained in:
committed by
Linus Torvalds
parent
350fce8dbf
commit
abd1f50094
@@ -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;
|
||||
|
Reference in New Issue
Block a user