On Mon, Oct 27, 2003 at 01:56:45AM -0800, David S. Miller wrote: > > It's easier to verify code when reference counts created locally > are released locally. So xfrm_user_policy() should drop the reference > to the policy it gets via km->compile_policy(). That is where > the second reference count comes from right? Yes. And in fact that's what my second patch does. > What's the simplest smallest fix to get rid of the timer ref > counting bug? Your patch here made it difficult for me to determine > exactly what case is wrong. The second patch that I sent you is the largest fix but IMHO the most maintainable. If you're really going for the minimal fix, then here it is. -- Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: kernel-source-2.5/net/xfrm/xfrm_policy.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/xfrm/xfrm_policy.c,v retrieving revision 1.27 diff -u -r1.27 xfrm_policy.c --- kernel-source-2.5/net/xfrm/xfrm_policy.c 18 Oct 2003 03:09:04 -0000 1.27 +++ kernel-source-2.5/net/xfrm/xfrm_policy.c 27 Oct 2003 11:00:31 -0000 @@ -201,7 +201,6 @@ expired: km_policy_expired(xp, dir, 1); xfrm_policy_delete(xp, dir); - xfrm_pol_put(xp); }