diff --git a/patches.suse/md-don-t-clear-MD_RECOVERY_FROZEN-for-new-dm-raid-un-2f03.patch b/patches.suse/md-don-t-clear-MD_RECOVERY_FROZEN-for-new-dm-raid-un-2f03.patch new file mode 100644 index 0000000..e16f583 --- /dev/null +++ b/patches.suse/md-don-t-clear-MD_RECOVERY_FROZEN-for-new-dm-raid-un-2f03.patch @@ -0,0 +1,54 @@ +From 2f03d0c2cd451c7ac2f317079d4ec518f0986b55 Mon Sep 17 00:00:00 2001 +From: Yu Kuai +Date: Tue, 5 Mar 2024 15:22:58 +0800 +Subject: [PATCH] md: don't clear MD_RECOVERY_FROZEN for new dm-raid until + resume +Git-commit: 2f03d0c2cd451c7ac2f317079d4ec518f0986b55 +Patch-mainline: v6.9-rc1 +References: git-fixes + +After commit 9dbd1aa3a81c ("dm raid: add reshaping support to the +target") raid_ctr() will set MD_RECOVERY_FROZEN before md_run() and +expect to keep array frozen until resume. However, md_run() will clear +the flag by setting mddev->recovery to 0. + +Before commit 1baae052cccd ("md: Don't ignore suspended array in +md_check_recovery()"), dm-raid actually relied on suspending to prevent +starting new sync_thread. + +Fix this problem by keeping 'MD_RECOVERY_FROZEN' for dm-raid in +md_run(). + +Fixes: 1baae052cccd ("md: Don't ignore suspended array in md_check_recovery()") +Fixes: 9dbd1aa3a81c ("dm raid: add reshaping support to the target") +Cc: stable@vger.kernel.org # v6.7+ +Signed-off-by: Yu Kuai +Signed-off-by: Xiao Ni +Acked-by: Mike Snitzer +Signed-off-by: Song Liu +Link: https://lore.kernel.org/r/20240305072306.2562024-2-yukuai1@huaweicloud.com +Signed-off-by: Coly Li + +--- + drivers/md/md.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/md/md.c b/drivers/md/md.c +index 48ae2b1cb57a..0c4e00e8d485 100644 +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -6062,7 +6062,10 @@ int md_run(struct mddev *mddev) + pr_warn("True protection against single-disk failure might be compromised.\n"); + } + +- mddev->recovery = 0; ++ /* dm-raid expect sync_thread to be frozen until resume */ ++ if (mddev->gendisk) ++ mddev->recovery = 0; ++ + /* may be over-ridden by personality */ + mddev->resync_max_sectors = mddev->dev_sectors; + +-- +2.35.3 + diff --git a/series.conf b/series.conf index 8129d7e..2723f46 100644 --- a/series.conf +++ b/series.conf @@ -45836,6 +45836,7 @@ patches.suse/md-Don-t-clear-MD_CLOSING-when-the-raid-is-about-to--9674.patch patches.suse/md-raid5-fix-atomicity-violation-in-raid5_cache_coun-dfd2.patch patches.suse/md-raid1-fix-choose-next-idle-in-read_balance-257a.patch + patches.suse/md-don-t-clear-MD_RECOVERY_FROZEN-for-new-dm-raid-un-2f03.patch patches.suse/RAS-Introduce-AMD-Address-Translation-Library.patch patches.suse/EDAC-amd64-Use-new-AMD-Address-Translation-Library.patch patches.suse/Documentation-RAS-Add-index-and-address-translation-sectio.patch