From: Herbert Xu Date: Wed, 9 May 2007 06:22:43 +0000 (-0700) Subject: [NET] link_watch: Eliminate potential delay on wrap-around X-Git-Tag: v2.6.22-rc1~34^2~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0ccffed91e234cad99a35f07d5a322f410baa2;p=linux-2.6 [NET] link_watch: Eliminate potential delay on wrap-around When the jiffies wrap around or when the system boots up for the first time, down events can be delayed indefinitely since we no longer update linkwatch_nextevent when only urgent events are processed. This patch fixes this by setting linkwatch_nextevent when a wrap-around occurs. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/core/link_watch.c b/net/core/link_watch.c index b5f45799c2..4674ae5741 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -101,8 +101,10 @@ static void linkwatch_schedule_work(unsigned long delay) return; /* If we wrap around we'll delay it by at most HZ. */ - if (delay > HZ) + if (delay > HZ) { + linkwatch_nextevent = jiffies; delay = 0; + } schedule_delayed_work(&linkwatch_work, delay); }