]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 May 2021 14:02:05 +0000 (16:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 May 2021 14:02:05 +0000 (16:02 +0200)
added patches:
md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch

queue-4.14/md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch b/queue-4.14/md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch
new file mode 100644 (file)
index 0000000..b4013b9
--- /dev/null
@@ -0,0 +1,35 @@
+From 2417b9869b81882ab90fd5ed1081a1cb2d4db1dd Mon Sep 17 00:00:00 2001
+From: Paul Clements <paul.clements@us.sios.com>
+Date: Thu, 15 Apr 2021 17:17:57 -0400
+Subject: md/raid1: properly indicate failure when ending a failed write request
+
+From: Paul Clements <paul.clements@us.sios.com>
+
+commit 2417b9869b81882ab90fd5ed1081a1cb2d4db1dd upstream.
+
+This patch addresses a data corruption bug in raid1 arrays using bitmaps.
+Without this fix, the bitmap bits for the failed I/O end up being cleared.
+
+Since we are in the failure leg of raid1_end_write_request, the request
+either needs to be retried (R1BIO_WriteError) or failed (R1BIO_Degraded).
+
+Fixes: eeba6809d8d5 ("md/raid1: end bio when the device faulty")
+Cc: stable@vger.kernel.org # v5.2+
+Signed-off-by: Paul Clements <paul.clements@us.sios.com>
+Signed-off-by: Song Liu <song@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/md/raid1.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/md/raid1.c
++++ b/drivers/md/raid1.c
+@@ -446,6 +446,8 @@ static void raid1_end_write_request(stru
+               if (!test_bit(Faulty, &rdev->flags))
+                       set_bit(R1BIO_WriteError, &r1_bio->state);
+               else {
++                      /* Fail the request */
++                      set_bit(R1BIO_Degraded, &r1_bio->state);
+                       /* Finished with this branch */
+                       r1_bio->bios[mirror] = NULL;
+                       to_put = bio;
index 283b1ee923b59f501b8cb9d854271844887b5fca..57850ccc84514dfe80e3c970bffa1f17b6a7c44b 100644 (file)
@@ -82,3 +82,4 @@ jffs2-fix-kasan-slab-out-of-bounds-problem.patch
 powerpc-eeh-fix-eeh-handling-for-hugepages-in-ioremap-space.patch
 powerpc-fix-edeadlock-redefinition-error-in-uapi-asm-errno.h.patch
 intel_th-pci-add-alder-lake-m-support.patch
+md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch