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
paride
amiflop.c m68k: amiflop - Get rid of sleep_on calls 2009-01-12 20:56:33 +01:00
ataflop.c
brd.c
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
cciss_cmd.h cciss: switch to using hlist for command list management 2008-12-29 08:28:43 +01:00
cciss_scsi.c
cciss_scsi.h
cpqarray.c
cpqarray.h
cryptoloop.c
DAC960.c
DAC960.h
floppy.c
hd.c
ida_cmd.h
ida_ioctl.h
Kconfig
loop.c loop: Do not call loop_unplug for not configured loop device. 2008-12-29 08:29:52 +01:00
Makefile
nbd.c nbd: fix I/O hang on disconnected nbds 2009-02-11 14:25:37 -08:00
pktcdvd.c
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
sx8.c
ub.c USB: change interface to usb_lock_device_for_reset() 2009-01-07 09:59:52 -08:00
umem.c
umem.h
viodasd.c
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
xd.h
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