nbd: prevent sock_xmit from attempting to use a NULL socket
commitffc41cf8dbb1b895a87daf47d0e5bf6dfbfcab4c
authorMike Snitzer <snitzer@gmail.com>
Wed, 2 Apr 2008 20:04:47 +0000 (2 13:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2008 22:28:19 +0000 (2 15:28 -0700)
tree465f41f6c4e0e63c58a94c893d0b4ec5c5e7a10d
parentf2b2ea692ec01768c77a4f532dcd060316460122
nbd: prevent sock_xmit from attempting to use a NULL socket

NBD does not protect the nbd_device's socket from becoming NULL during
receives.

This closes a race with the NBD_CLEAR_SOCK ioctl (nbd-client -d) setting
the nbd_device's socket to NULL right before NBD calls sock_xmit.

Signed-off-by: Mike Snitzer <snitzer@gmail.com>
Cc: Paul Clements <paul.clements@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/nbd.c