<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: NeilBrown &lt;neilb@cse.unsw.edu.au&gt;

Fix a leak: when auth_unix_lookup sets CACHE_NEGATIVE, it should also
auth_domain_put() the reference it holds in ipm-&gt;m_client, since setting
CACHE_NEGATIVE prevents ip_map_put() from putting the reference itself.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Neil Brown &lt;neilb@cse.unsw.edu.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/net/sunrpc/svcauth_unix.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN net/sunrpc/svcauth_unix.c~nfsd-fix-ip_map-cache-reference-count-leak net/sunrpc/svcauth_unix.c
--- 25/net/sunrpc/svcauth_unix.c~nfsd-fix-ip_map-cache-reference-count-leak	2004-08-01 21:09:56.781374752 -0700
+++ 25-akpm/net/sunrpc/svcauth_unix.c	2004-08-01 21:09:56.785374144 -0700
@@ -316,7 +316,8 @@ struct auth_domain *auth_unix_lookup(str
 		return NULL;
 
 	if ((ipm-&gt;m_client-&gt;addr_changes - ipm-&gt;m_add_change) &gt;0) {
-		set_bit(CACHE_NEGATIVE, &amp;ipm-&gt;h.flags);
+		if (test_and_set_bit(CACHE_NEGATIVE, &amp;ipm-&gt;h.flags) == 0)
+			auth_domain_put(&amp;ipm-&gt;m_client-&gt;h);
 		rv = NULL;
 	} else {
 		rv = &amp;ipm-&gt;m_client-&gt;h;
_
</pre></body></html>