Re: [Patch] (revised) net/xfrm/xfrm_policy.c: replace timer with delayed_work

From: Herbert Xu
Date: Mon May 05 2008 - 23:08:47 EST


On Fri, May 02, 2008 at 01:35:55PM +0800, WANG Cong wrote:
>
> @@ -209,16 +210,16 @@ static void xfrm_policy_timer(unsigned long data)
> if (warn)
> km_policy_expired(xp, dir, 0, 0);
> if (next != LONG_MAX &&
> - !mod_timer(&xp->timer, jiffies + make_jiffies(next)))
> + !schedule_delayed_work(&xp->work, make_jiffies(next)))
> xfrm_pol_hold(xp);

I tried it and it pretty much crashed immediately :)

The problem is that schedule_delayed_work's return value is the
opposite of mod_timer. So you'll need to reverse the tests.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/