]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2014 20:06:46 +0000 (12:06 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2014 20:06:46 +0000 (12:06 -0800)
added patches:
md-raid5-fix-long-standing-problem-with-bitmap-handling-on-write-failure.patch

queue-3.10/md-raid5-fix-long-standing-problem-with-bitmap-handling-on-write-failure.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/md-raid5-fix-long-standing-problem-with-bitmap-handling-on-write-failure.patch b/queue-3.10/md-raid5-fix-long-standing-problem-with-bitmap-handling-on-write-failure.patch
new file mode 100644 (file)
index 0000000..6bf3394
--- /dev/null
@@ -0,0 +1,46 @@
+From 9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 16 Jan 2014 09:35:38 +1100
+Subject: md/raid5: fix long-standing problem with bitmap handling on write failure.
+
+From: NeilBrown <neilb@suse.de>
+
+commit 9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669 upstream.
+
+Before a write starts we set a bit in the write-intent bitmap.
+When the write completes we clear that bit if the write was successful
+to all devices.  However if the write wasn't fully successful we
+should not clear the bit.  If the faulty drive is subsequently
+re-added, the fact that the bit is still set ensure that we will
+re-write the data that is missing.
+
+This logic is mediated by the STRIPE_DEGRADED flag - we only clear the
+bitmap bit when this flag is not set.
+Currently we correctly set the flag if a write starts when some
+devices are failed or missing.  But we do *not* set the flag if some
+device failed during the write attempt.
+This is wrong and can result in clearing the bit inappropriately.
+
+So: set the flag when a write fails.
+
+This bug has been present since bitmaps were introduces, so the fix is
+suitable for any -stable kernel.
+
+Reported-by: Ethan Wilson <ethan.wilson@shiftmail.org>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/raid5.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/md/raid5.c
++++ b/drivers/md/raid5.c
+@@ -1893,6 +1893,7 @@ static void raid5_end_write_request(stru
+                       set_bit(R5_MadeGoodRepl, &sh->dev[i].flags);
+       } else {
+               if (!uptodate) {
++                      set_bit(STRIPE_DEGRADED, &sh->state);
+                       set_bit(WriteErrorSeen, &rdev->flags);
+                       set_bit(R5_WriteError, &sh->dev[i].flags);
+                       if (!test_and_set_bit(WantReplacement, &rdev->flags))
index ac4d3c020f2edb6d861f8129f3a51ced0aaac6c3..553908a40fd4ff354bf4fe34c421f1de60b5352e 100644 (file)
@@ -1 +1,2 @@
 kvm-x86-fix-apic_base-enable-check.patch
+md-raid5-fix-long-standing-problem-with-bitmap-handling-on-write-failure.patch