aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-11-24 12:51:55 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-11-24 14:29:07 -0500
commita8d82d9b950213b66b22c9e7c63a058841de2394 (patch)
tree58334c88a7a32c88648d84a0858a0ed08ba28ab5 /fs/lockd/host.c
parente4625eb826de4f6774ee602c442ba23b686bdcc7 (diff)
NLM: client-side nlm_lookup_host() should avoid matching on srcaddr
Since commit c98451bd, the loop in nlm_lookup_host() unconditionally compares the host's h_srcaddr field to the incoming source address. For client-side nlm_host entries, both are always AF_UNSPEC, so this check is unnecessary. Since commit 781b61a6, which added support for AF_INET6 addresses to nlm_cmp_addr(), nlm_cmp_addr() now returns FALSE for AF_UNSPEC addresses, which causes nlm_lookup_host() to create a fresh nlm_host entry every time it is called on the client. These extra entries will eventually expire once the server is unmounted, so the impact of this regression, introduced with lockd IPv6 support in 2.6.28, should be minor. We could fix this by adding an arm in nlm_cmp_addr() for AF_UNSPEC addresses, but really, nlm_lookup_host() shouldn't be matching on the srcaddr field for client-side nlm_host lookups. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r--fs/lockd/host.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 9fd8889097b7..70fc63a1727b 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -167,7 +167,8 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
167 continue; 167 continue;
168 if (host->h_server != ni->server) 168 if (host->h_server != ni->server)
169 continue; 169 continue;
170 if (!nlm_cmp_addr(nlm_srcaddr(host), ni->src_sap)) 170 if (ni->server &&
171 !nlm_cmp_addr(nlm_srcaddr(host), ni->src_sap))
171 continue; 172 continue;
172 173
173 /* Move to head of hash chain. */ 174 /* Move to head of hash chain. */