[kernel] r19777 - in dists/sid/linux/debian: . patches patches/bugfix/all

Ben Hutchings benh at alioth.debian.org
Sun Jan 27 00:41:07 UTC 2013


Author: benh
Date: Sun Jan 27 00:41:05 2013
New Revision: 19777

Log:
md: protect against crash upon fsync on ro array (Closes: #696650)

Added:
   dists/sid/linux/debian/patches/bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Sun Jan 27 00:14:04 2013	(r19776)
+++ dists/sid/linux/debian/changelog	Sun Jan 27 00:41:05 2013	(r19777)
@@ -99,6 +99,7 @@
     - rewrite punch hole to use ext4_ext_remove_space()
     - fix hole punch failure when depth is greater than 0
     - fix kernel BUG on large-scale rm -rf commands
+  * md: protect against crash upon fsync on ro array (Closes: #696650)
 
   [ Aurelien Jarno ]
   * [armhf/vexpress] Add kernel udebs.

Added: dists/sid/linux/debian/patches/bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch	Sun Jan 27 00:41:05 2013	(r19777)
@@ -0,0 +1,35 @@
+From: Sebastian Riemer <sebastian.riemer at profitbricks.com>
+Date: Fri, 25 Jan 2013 12:46:59 +0100
+Subject: [PATCH] md: protect against crash upon fsync on ro array
+Bug-Debian: http://bugs.debian.org/696650
+
+If an fsync occurrs on a read-only array, we need to send a
+completion for the IO and may not increment the active IO count.
+Otherwise, we hit a bug trace and can't stop the MD array anymore.
+
+As return value -EROFS makes most sense.
+
+Signed-off-by: Sebastian Riemer <sebastian.riemer at profitbricks.com>
+---
+ drivers/md/md.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/md/md.c b/drivers/md/md.c
+index 3db3d1b..475e0be 100644
+--- a/drivers/md/md.c
++++ b/drivers/md/md.c
+@@ -322,6 +322,11 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
+ 		}
+ 		finish_wait(&mddev->sb_wait, &__wait);
+ 	}
++	if (mddev->ro == 1 && unlikely(rw == WRITE)) {
++		rcu_read_unlock();
++		bio_endio(bio, -EROFS);
++		return;
++	}
+ 	atomic_inc(&mddev->active_io);
+ 	rcu_read_unlock();
+ 
+-- 
+1.7.1
+

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Sun Jan 27 00:14:04 2013	(r19776)
+++ dists/sid/linux/debian/patches/series	Sun Jan 27 00:41:05 2013	(r19777)
@@ -471,3 +471,4 @@
 bugfix/all/ext4-rewrite-punch-hole-to-use-ext4_ext_remove_space.patch
 bugfix/all/ext4-fix-hole-punch-failure-when-depth-is-greater-th.patch
 bugfix/all/ext4-fix-kernel-BUG-on-large-scale-rm-rf-commands.patch
+bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch



More information about the Kernel-svn-changes mailing list