]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[NET]: gen_estimator deadlock fix
authorRanko Zivojnovic <ranko@spidernet.net>
Tue, 17 Jul 2007 01:28:32 +0000 (18:28 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 18 Jul 2007 08:46:50 +0000 (01:46 -0700)
commit0929c2dd83317813425b937fbc0041013b8685ff
tree00b7dfc35f18dd059b8ea5a6d0a151754c19a974
parentdd121c4bbf60336773485e91b5cfc57596b45151
[NET]: gen_estimator deadlock fix

-Fixes ABBA deadlock noted by Patrick McHardy <kaber@trash.net>:

> There is at least one ABBA deadlock, est_timer() does:
> read_lock(&est_lock)
> spin_lock(e->stats_lock) (which is dev->queue_lock)
>
> and qdisc_destroy calls htb_destroy under dev->queue_lock, which
> calls htb_destroy_class, then gen_kill_estimator and this
> write_locks est_lock.

To fix the ABBA deadlock the rate estimators are now kept on an rcu list.

-The est_lock changes the use from protecting the list to protecting
the update to the 'bstat' pointer in order to avoid NULL dereferencing.

-The 'interval' member of the gen_estimator structure removed as it is
not needed.

Signed-off-by: Ranko Zivojnovic <ranko@spidernet.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/gen_estimator.c