Skip to content

Commit

Permalink
[NET] link_watch: Eliminate potential delay on wrap-around
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
herbertx authored and David S. Miller committed May 11, 2007
1 parent 4cd8c9e commit db0ccff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/core/link_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit db0ccff

Please sign in to comment.