pkt_sched: Use qdisc_lock() on already sampled root qdisc.
Based upon a bug report by Jeff Kirsher. Don't use qdisc_root_lock() in these cases as the root qdisc could have been changed, and we'd thus lock the wrong object. Tested by Emil S Tantilov who confirms that this seems to fix the problem. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -1796,7 +1796,7 @@ gso:
|
||||
skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS);
|
||||
#endif
|
||||
if (q->enqueue) {
|
||||
spinlock_t *root_lock = qdisc_root_lock(q);
|
||||
spinlock_t *root_lock = qdisc_lock(q);
|
||||
|
||||
spin_lock(root_lock);
|
||||
|
||||
@@ -1995,7 +1995,7 @@ static void net_tx_action(struct softirq_action *h)
|
||||
smp_mb__before_clear_bit();
|
||||
clear_bit(__QDISC_STATE_SCHED, &q->state);
|
||||
|
||||
root_lock = qdisc_root_lock(q);
|
||||
root_lock = qdisc_lock(q);
|
||||
if (spin_trylock(root_lock)) {
|
||||
qdisc_run(q);
|
||||
spin_unlock(root_lock);
|
||||
|
Reference in New Issue
Block a user