[kernel] r14381 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/series

Moritz Muehlenhoff jmm at alioth.debian.org
Tue Oct 13 19:50:52 UTC 2009


Author: jmm
Date: Tue Oct 13 19:50:51 2009
New Revision: 14381

Log:
* nbd: fix I/O hang on disconnected NDBs. (Closes: #550863)

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/nbd-fix-io-hang-on-disconnected-nbds.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/20

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Tue Oct 13 05:17:42 2009	(r14380)
+++ dists/lenny/linux-2.6/debian/changelog	Tue Oct 13 19:50:51 2009	(r14381)
@@ -36,7 +36,10 @@
   [ maximilian attems ]
   * [openvz] enable SYSFS_DEPRECATED_V2 for ipv6 tunnels through sit.
     (closes: #517892)
-
+	
+  [ Moritz Muehlenhoff ]
+  * nbd: fix I/O hang on disconnected NDBs. (Closes: #550863)
+	
  -- Ben Hutchings <ben at decadent.org.uk>  Fri, 21 Aug 2009 00:11:55 +0100
 
 linux-2.6 (2.6.26-19) stable; urgency=high

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/nbd-fix-io-hang-on-disconnected-nbds.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/nbd-fix-io-hang-on-disconnected-nbds.patch	Tue Oct 13 19:50:51 2009	(r14381)
@@ -0,0 +1,64 @@
+From: Paul Clements <paul.clements at steeleye.com>
+Date: Wed, 11 Feb 2009 21:04:45 +0000 (-0800)
+Subject: nbd: fix I/O hang on disconnected nbds
+X-Git-Tag: v2.6.29-rc5~8
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=4d48a542b42747c36a5937447d9c3de7c897ea50
+
+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 at steeleye.com>
+Reported-by: Jon Nelson <jnelson-kernel-bugzilla at jamponi.net>
+Acked-by: Pavel Machek <pavel at ucw.cz>
+Cc: <stable at kernel.org>		[2.6.26.x, 2.6.27.x, 2.6.28.x]
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+---
+
+diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
+index 34f80fa..8299e2d 100644
+--- a/drivers/block/nbd.c
++++ b/drivers/block/nbd.c
+@@ -549,6 +549,15 @@ static void do_nbd_request(struct request_queue * q)
+ 
+ 		BUG_ON(lo->magic != LO_MAGIC);
+ 
++		if (unlikely(!lo->sock)) {
++			printk(KERN_ERR "%s: Attempted send on closed socket\n",
++				lo->disk->disk_name);
++			req->errors++;
++			nbd_end_request(req);
++			spin_lock_irq(q->queue_lock);
++			continue;
++		}
++
+ 		spin_lock_irq(&lo->queue_lock);
+ 		list_add_tail(&req->queuelist, &lo->waiting_queue);
+ 		spin_unlock_irq(&lo->queue_lock);

Modified: dists/lenny/linux-2.6/debian/patches/series/20
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/20	Tue Oct 13 05:17:42 2009	(r14380)
+++ dists/lenny/linux-2.6/debian/patches/series/20	Tue Oct 13 19:50:51 2009	(r14381)
@@ -16,3 +16,4 @@
 + bugfix/all/r8169-fix-rx_missed_errors.patch
 + bugfix/all/hfsplus-limit-to-2tb.patch
 + features/all/ftdi_sio-openrd.patch
++ bugfix/all/nbd-fix-io-hang-on-disconnected-nbds.patch
\ No newline at end of file



More information about the Kernel-svn-changes mailing list