]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] nfsd: fix ip_map cache reference count leak.
authorNeil Brown <neilb@cse.unsw.edu.au>
Mon, 23 Aug 2004 06:01:08 +0000 (23:01 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 06:01:08 +0000 (23:01 -0700)
Fix a leak: when auth_unix_lookup sets CACHE_NEGATIVE, it should also
auth_domain_put() the reference it holds in ipm->m_client, since setting
CACHE_NEGATIVE prevents ip_map_put() from putting the reference itself.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
net/sunrpc/svcauth_unix.c

index 949a33f753d91ab9577a3ced864cc41efd56e66b..10e21d0812ae8b24ed21d42aad17f42b9a7211e3 100644 (file)
@@ -316,7 +316,8 @@ struct auth_domain *auth_unix_lookup(struct in_addr addr)
                return NULL;
 
        if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
-               set_bit(CACHE_NEGATIVE, &ipm->h.flags);
+               if (test_and_set_bit(CACHE_NEGATIVE, &ipm->h.flags) == 0)
+                       auth_domain_put(&ipm->m_client->h);
                rv = NULL;
        } else {
                rv = &ipm->m_client->h;