]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[NET]: gen_estimator deadlock fix
authorRanko Zivojnovic <ranko@spidernet.net>
Fri, 2 Nov 2007 21:51:48 +0000 (22:51 +0100)
committerAdrian Bunk <bunk@kernel.org>
Fri, 2 Nov 2007 21:51:48 +0000 (22:51 +0100)
commit2ba6064c00a38885e8997059908f9aed5299e196
tree4c209e2ba0a0d3a3940b73c7d2a101f61bd4a9a9
parent464aa9b9720276ed68162bbd86e346538e515c59
[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>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
net/core/gen_estimator.c