linux/drivers/block
Paul Clements 4d48a542b4 nbd: fix I/O hang on disconnected nbds
Fix a problem that causes I/O to a disconnected (or partially initialized)
nbd device to hang indefinitely.  To reproduce:

# ioctl NBD_SET_SIZE_BLOCKS /dev/nbd23 514048
# dd if=/dev/nbd23 of=/dev/null bs=4096 count=1

...hangs...

This can also occur when an nbd device loses its nbd-client/server
connection.  Although we clear the queue of any outstanding I/Os after the
client/server connection fails, any additional I/Os that get queued later
will hang.

This bug may also be the problem reported in this bug report:
http://bugzilla.kernel.org/show_bug.cgi?id=12277

Testing would need to be performed to determine if the two issues are the
same.

This problem was introduced by the new request handling thread code ("NBD:
allow nbd to be used locally", 3/2008), which entered into mainline around
2.6.25.

The fix, which is fairly simple, is to restore the check for lo->sock
being NULL in do_nbd_request.  This causes I/O to an uninitialized nbd to
immediately fail with an I/O error, as it did prior to the introduction of
this bug.

Signed-off-by: Paul Clements <paul.clements@steeleye.com>
Reported-by: Jon Nelson <jnelson-kernel-bugzilla@jamponi.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: <stable@kernel.org>		[2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-02-11 14:25:37 -08:00
..
aoe aoe: remove private mac address format function 2008-11-25 00:40:37 -08:00
paride [PATCH] switch pf 2008-10-21 07:47:59 -04:00
amiflop.c m68k: amiflop - Get rid of sleep_on calls 2009-01-12 20:56:33 +01:00
ataflop.c [PATCH] switch ataflop 2008-10-21 07:47:42 -04:00
brd.c [PATCH] switch brd 2008-10-21 07:47:44 -04:00
cciss_cmd.h cciss: switch to using hlist for command list management 2008-12-29 08:28:43 +01:00
cciss_scsi.c cciss: Fix cciss SCSI rescan code to better notice device changes 2008-10-09 08:56:18 +02:00
cciss_scsi.h cciss: Fix cciss SCSI rescan code to better notice device changes 2008-10-09 08:56:18 +02:00
cciss.c cciss: simplify parameters to deregister_disk function 2008-12-29 08:29:52 +01:00
cciss.h cciss: switch to using hlist for command list management 2008-12-29 08:28:43 +01:00
cpqarray.c cpqarry: fix return value of cpqarray_init() 2008-11-06 15:41:17 -08:00
cpqarray.h
cryptoloop.c drivers: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:16:32 -04:00
DAC960.c [PATCH] switch DAC960 2008-10-21 07:47:36 -04:00
DAC960.h Fix DAC960 driver on machines which don't support 64-bit DMA 2007-09-11 17:21:19 -07:00
floppy.c Create/use more directory structure in the Documentation/ tree. 2008-11-14 17:28:53 +00:00
hd.c hd: WIN_* -> ATA_CMD_* 2008-10-10 22:39:21 +02:00
ida_cmd.h
ida_ioctl.h
Kconfig Create/use more directory structure in the Documentation/ tree. 2008-11-14 17:28:53 +00:00
loop.c loop: Do not call loop_unplug for not configured loop device. 2008-12-29 08:29:52 +01:00
Makefile move ide/legacy/hd.c to drivers/block/ 2008-07-16 20:33:47 +02:00
nbd.c nbd: fix I/O hang on disconnected nbds 2009-02-11 14:25:37 -08:00
pktcdvd.c pktcdvd: remove broken dev_t export of class devices 2008-12-10 10:03:32 -08:00
ps3disk.c powerpc/ps3: Printing fixups for l64 to ll64 conversion drivers/block 2009-01-16 16:15:13 +11:00
smart1,2.h
sunvdc.c sparc64: Fix unsigned long long warnings in drivers. 2009-01-06 13:20:38 -08:00
swim3.c [PATCH] switch swim3 2008-10-21 07:48:03 -04:00
sx8.c block: replace remaining __FUNCTION__ occurrences 2008-04-21 09:51:04 +02:00
ub.c USB: change interface to usb_lock_device_for_reset() 2009-01-07 09:59:52 -08:00
umem.c Cleanup umem driver: fix most checkpatch warnings, conform to kernel 2007-12-18 08:29:28 +01:00
umem.h drivers/block/umem: trim trailing whitespace 2007-10-10 09:25:59 +02:00
viodasd.c [PATCH] switch viodasd 2008-10-21 07:48:07 -04:00
virtio_blk.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2008-12-30 17:37:25 -08:00
xd.c [PATCH] switch xd 2008-10-21 07:48:11 -04:00
xd.h [PATCH] switch xd 2008-10-21 07:48:11 -04:00
xen-blkfront.c xen-blkfront: set queue paravirt flag 2008-12-29 08:28:41 +01:00
xsysace.c powerpc/xsysace: add compatible string for non-ipcore instance 2009-01-09 15:49:06 -07:00
z2ram.c [PATCH] switch z2ram 2008-10-21 07:48:17 -04:00