This is a note to let you know that I've just added the patch titled md: don't clear MD_RECOVERY_FROZEN for new dm-raid until resume to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: md-don-t-clear-md_recovery_frozen-for-new-dm-raid-un.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit ea777cc378c910623d6c356b6594da81826eda97 Author: Yu Kuai <yukuai3@xxxxxxxxxx> Date: Tue Mar 5 15:22:58 2024 +0800 md: don't clear MD_RECOVERY_FROZEN for new dm-raid until resume [ Upstream commit 2f03d0c2cd451c7ac2f317079d4ec518f0986b55 ] 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@xxxxxxxxxxxxxxx # v6.7+ Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx> Signed-off-by: Xiao Ni <xni@xxxxxxxxxx> Acked-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Song Liu <song@xxxxxxxxxx> Link: https://lore.kernel.org/r/20240305072306.2562024-2-yukuai1@xxxxxxxxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/md/md.c b/drivers/md/md.c index fbe528ed236f6..3d3a419190042 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6039,7 +6039,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;