From: Greg Kroah-Hartman Date: Sun, 9 May 2021 14:02:05 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.4.118~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eee090f5e043fe748752ea95dc71f497bbff1c31;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch --- 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 index 00000000000..b4013b9cd52 --- /dev/null +++ b/queue-4.14/md-raid1-properly-indicate-failure-when-ending-a-failed-write-request.patch @@ -0,0 +1,35 @@ +From 2417b9869b81882ab90fd5ed1081a1cb2d4db1dd Mon Sep 17 00:00:00 2001 +From: Paul Clements +Date: Thu, 15 Apr 2021 17:17:57 -0400 +Subject: md/raid1: properly indicate failure when ending a failed write request + +From: Paul Clements + +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 +Signed-off-by: Song Liu +Signed-off-by: Greg Kroah-Hartman +--- + 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; diff --git a/queue-4.14/series b/queue-4.14/series index 283b1ee923b..57850ccc845 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -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