[NET]: Fix race between poll_napi() and net_rx_action()
authorDavid S. Miller <davem@sunset.davemloft.net>
Tue, 30 Oct 2007 04:28:47 +0000 (21:28 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 30 Oct 2007 05:37:28 +0000 (22:37 -0700)
netpoll_poll_lock() synchronizes the ->poll() invocation
code paths, but once we have the lock we have to make
sure that NAPI_STATE_SCHED is still set.  Otherwise we
get:

cpu 0 cpu 1

net_rx_action() poll_napi()
netpoll_poll_lock() ... spin on ->poll_lock
->poll()
  netif_rx_complete
netpoll_poll_unlock() acquire ->poll_lock()
->poll()
 netif_rx_complete()
 CRASH

Based upon a bug report from Tina Yang.

Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found