From: Jarek Poplawski Date: Mon, 8 Sep 2008 01:41:21 +0000 (-0700) Subject: pkt_sched: Fix qdisc state in net_tx_action() X-Git-Tag: v2.6.27-rc6~18^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8a83e10d7dfe5d0841062780769b30f65417e15;p=profile%2Fivi%2Fkernel-x86-ivi.git pkt_sched: Fix qdisc state in net_tx_action() net_tx_action() can skip __QDISC_STATE_SCHED bit clearing while qdisc is neither ran nor rescheduled, which may cause endless loop in dev_deactivate(). Reported-by: Denys Fedoryshchenko Tested-by: Denys Fedoryshchenko Signed-off-by: Jarek Poplawski Acked-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 60c51f7..e719ed2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1991,8 +1991,13 @@ static void net_tx_action(struct softirq_action *h) spin_unlock(root_lock); } else { if (!test_bit(__QDISC_STATE_DEACTIVATED, - &q->state)) + &q->state)) { __netif_reschedule(q); + } else { + smp_mb__before_clear_bit(); + clear_bit(__QDISC_STATE_SCHED, + &q->state); + } } } }