alistair23-linux/net/core
Eric Dumazet c57b546840 pktgen: fix crash at module unload
commit 7d3d43dab4 (net: In unregister_netdevice_notifier unregister
the netdevices.) makes pktgen crashing at module unload.

[  296.820578] BUG: spinlock bad magic on CPU#6, rmmod/3267
[  296.820719]  lock: ffff880310c38000, .magic: ffff8803, .owner: <none>/-1, .owner_cpu: -1
[  296.820943] Pid: 3267, comm: rmmod Not tainted 3.4.0-rc5+ #254
[  296.821079] Call Trace:
[  296.821211]  [<ffffffff8168a715>] spin_dump+0x8a/0x8f
[  296.821345]  [<ffffffff8168a73b>] spin_bug+0x21/0x26
[  296.821507]  [<ffffffff812b4741>] do_raw_spin_lock+0x131/0x140
[  296.821648]  [<ffffffff8169188e>] _raw_spin_lock+0x1e/0x20
[  296.821786]  [<ffffffffa00cc0fd>] __pktgen_NN_threads+0x4d/0x140 [pktgen]
[  296.821928]  [<ffffffffa00ccf8d>] pktgen_device_event+0x10d/0x1e0 [pktgen]
[  296.822073]  [<ffffffff8154ed4f>] unregister_netdevice_notifier+0x7f/0x100
[  296.822216]  [<ffffffffa00d2a0b>] pg_cleanup+0x48/0x73 [pktgen]
[  296.822357]  [<ffffffff8109528e>] sys_delete_module+0x17e/0x2a0
[  296.822502]  [<ffffffff81699652>] system_call_fastpath+0x16/0x1b

Hold the pktgen_thread_lock while splicing pktgen_threads, and test
pktgen_exiting in pktgen_device_event() to make unload faster.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 23:10:24 -04:00
..
datagram.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
dev.c Revert "net: maintain namespace isolation between vlan and real device" 2012-05-10 23:03:34 -04:00
dev_addr_lists.c net: fix /proc/net/dev regression 2012-04-03 17:23:23 -04:00
drop_monitor.c drop_monitor: prevent init path from scheduling on the wrong cpu 2012-05-02 21:02:48 -04:00
dst.c net: Rename dst_get_neighbour{, _raw} to dst_get_neighbour_noref{, _raw}. 2011-12-05 15:20:19 -05:00
ethtool.c net: Support RX-ALL feature flag. 2012-02-24 01:42:07 -08:00
fib_rules.c net: Fix files explicitly needing to include module.h 2011-10-31 19:30:28 -04:00
filter.c bpf jit: Make the filter.c::__load_pointer helper non-static for the jits 2012-04-03 18:01:03 -04:00
flow.c net: Add a flow_cache_flush_deferred function 2011-12-21 16:48:08 -05:00
flow_dissector.c net: flow_dissector.c missing include linux/export.h 2012-01-24 16:03:33 -05:00
gen_estimator.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
gen_stats.c net/core: EXPORT_SYMBOL cleanups 2010-07-12 12:57:55 -07:00
iovec.c net: get rid of some pointless casts to sockaddr 2012-03-11 19:11:22 -07:00
kmap_skb.h net: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:27 +08:00
link_watch.c net: linkwatch: allow vlans to get carrier changes faster 2011-09-15 15:36:34 -04:00
Makefile sock_diag: Move the sock_ code to net/core/ 2011-12-06 13:58:02 -05:00
neighbour.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-02-26 21:55:51 -05:00
net-sysfs.c static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
net-sysfs.h xps: Add CONFIG_XPS 2010-11-28 18:24:14 -08:00
net-traces.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
net_namespace.c netns: do not leak net_generic data on failed init 2012-04-18 00:05:33 -04:00
netevent.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
netpoll.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-02-19 16:03:15 -05:00
netprio_cgroup.c Merge branch 'for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2012-03-20 18:11:21 -07:00
pktgen.c pktgen: fix crash at module unload 2012-05-10 23:10:24 -04:00
request_sock.c ipv4:correct description for tcp_max_syn_backlog 2011-12-06 13:02:28 -05:00
rtnetlink.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
scm.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
secure_seq.c net: fix some sparse errors 2012-01-17 10:31:12 -05:00
skbuff.c net: allow pskb_expand_head() to get maximum tailroom 2012-04-11 10:10:43 -04:00
sock.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sock_diag.c sock_diag: Introduce the meminfo nla core (v2) 2011-12-30 16:42:19 -05:00
stream.c net: Fix the condition passed to sk_wait_event() 2010-10-03 20:41:32 -07:00
sysctl_net_core.c static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
timestamping.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
user_dma.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
utils.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00