]> git.baikalelectronics.ru Git - kernel.git/commit
pktgen: make sure that pktgen_thread_worker has been executed
authorDenis V. Lunev <den@openvz.org>
Tue, 20 May 2008 22:12:44 +0000 (15:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 May 2008 22:12:44 +0000 (15:12 -0700)
commit0b8a4da6b78eaa2573b49d55d2629f4c5ee07261
tree2875979c06b127edc325bf77518837c28477ebd5
parent39b67414a4202407a00b6f8cdcaac4628c554e60
pktgen: make sure that pktgen_thread_worker has been executed

The following courruption can happen during pktgen stop:
list_del corruption. prev->next should be ffff81007e8a5e70, but was 6b6b6b6b6b6b6b6b
kernel BUG at lib/list_debug.c:67!
      :pktgen:pktgen_thread_worker+0x374/0x10b0
      ? autoremove_wake_function+0x0/0x40
      ? _spin_unlock_irqrestore+0x42/0x80
      ? :pktgen:pktgen_thread_worker+0x0/0x10b0
      kthread+0x4d/0x80
      child_rip+0xa/0x12
      ? restore_args+0x0/0x30
      ? kthread+0x0/0x80
      ? child_rip+0x0/0x12
RIP  list_del+0x48/0x70

The problem is that pktgen_thread_worker can not be executed if kthread_stop
has been called too early. Insert a completion on the normal initialization
path to make sure that pktgen_thread_worker will gain the control for sure.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c