diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-03 05:02:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-03 05:02:43 +0200 |
commit | 5fb662297b8a4bdadd60371c34b760efca948ebc (patch) | |
tree | ef1def70cfa440ab3d367f6f67d466227ffdf0ef /net/core | |
parent | rt2x00: Fix compile warning (diff) | |
download | linux-5fb662297b8a4bdadd60371c34b760efca948ebc.tar.xz linux-5fb662297b8a4bdadd60371c34b760efca948ebc.zip |
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>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 69320a56a084..da7acacf02b5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -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); |