pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() race
dev_deactivate() can skip rescheduling of a qdisc by qdisc_watchdog() or other timer calling netif_schedule() after dev_queue_deactivate(). We prevent this checking aliveness before scheduling the timer. Since during deactivation the root qdisc is available only as qdisc_sleeping additional accessor qdisc_root_sleeping() is created. With feedback from Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5e739d1752
commit
2540e0511e
@@ -521,6 +521,10 @@ static void cbq_ovl_delay(struct cbq_class *cl)
|
||||
struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
|
||||
psched_tdiff_t delay = cl->undertime - q->now;
|
||||
|
||||
if (test_bit(__QDISC_STATE_DEACTIVATED,
|
||||
&qdisc_root_sleeping(cl->qdisc)->state))
|
||||
return;
|
||||
|
||||
if (!cl->delayed) {
|
||||
psched_time_t sched = q->now;
|
||||
ktime_t expires;
|
||||
|
Reference in New Issue
Block a user