Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db0ccffe authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

[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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4cd8c9e8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);
}