• David S. Miller's avatar
    [NET]: Fix race between poll_napi() and net_rx_action() · 0a7606c1
    David S. Miller authored
    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: default avatarDavid S. Miller <davem@davemloft.net>
    0a7606c1
dev.c 108 KB