]> bbs.cooldavid.org Git - net-next-2.6.git/commit
netpoll: Add locking for netpoll_setup/cleanup
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Jun 2010 16:12:46 +0000 (16:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Jun 2010 17:58:39 +0000 (10:58 -0700)
commitdbaa154178341689faaa08fbf40b94ae5ca1d6c0
treeb50b944ea7ed9b5ee86fd389e6089f30b261e7ae
parentde85d99eb7b595f6751550184b94c1e2f74a828b
netpoll: Add locking for netpoll_setup/cleanup

As it stands, netpoll_setup and netpoll_cleanup have no locking
protection whatsoever.  So chaos ensures if two entities try to
perform them on the same device.

This patch adds RTNL to the equation.  The code has been rearranged so
that bits that do not need RTNL protection are now moved to the top of
netpoll_setup.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c