net/dst: dst_dev_event() called after other notifiers
commit44a913f55f16aa0495a378f62252512cf3ad4b29
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 9 Nov 2010 19:46:33 +0000 (9 11:46 -0800)
committerAK <andi@firstfloor.org>
Sun, 6 Feb 2011 19:03:39 +0000 (6 11:03 -0800)
treee6cd672aaba8b73e69f9aeaafbfe655b4b33aa7b
parent0480c8a2bbec4fbc07c87cf035b0a55c20e97911
net/dst: dst_dev_event() called after other notifiers

[ Upstream commit 332dd96f7ac15e937088fe11f15cfe0210e8edd1 ]

Followup of commit ef885afbf8a37689 (net: use rcu_barrier() in
rollback_registered_many)

dst_dev_event() scans a garbage dst list that might be feeded by various
network notifiers at device dismantle time.

Its important to call dst_dev_event() after other notifiers, or we might
enter the infamous msleep(250) in netdev_wait_allrefs(), and wait one
second before calling again call_netdevice_notifiers(NETDEV_UNREGISTER,
dev) to properly remove last device references.

Use priority -10 to let dst_dev_notifier be called after other network
notifiers (they have the default 0 priority)

Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reported-by: Octavian Purdila <opurdila@ixiacom.com>
Reported-by: Benjamin LaHaise <bcrl@kvack.org>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
net/core/dst.c