diff --git a/patches.suse/dm-raid-fix-lockdep-waring-in-pers-hot_add_disk-9500.patch b/patches.suse/dm-raid-fix-lockdep-waring-in-pers-hot_add_disk-9500.patch new file mode 100644 index 0000000..a4efc06 --- /dev/null +++ b/patches.suse/dm-raid-fix-lockdep-waring-in-pers-hot_add_disk-9500.patch @@ -0,0 +1,49 @@ +From 95009ae904b1e9dca8db6f649f2d7c18a6e42c75 Mon Sep 17 00:00:00 2001 +From: Yu Kuai +Date: Tue, 5 Mar 2024 15:23:06 +0800 +Subject: [PATCH] dm-raid: fix lockdep waring in "pers->hot_add_disk" +Git-commit: 95009ae904b1e9dca8db6f649f2d7c18a6e42c75 +Patch-mainline: v6.9-rc1 +References: git-fixes + +The lockdep assert is added by commit a448af25becf ("md/raid10: remove +rcu protection to access rdev from conf") in print_conf(). And I didn't +notice that dm-raid is calling "pers->hot_add_disk" without holding +'reconfig_mutex'. + +"pers->hot_add_disk" read and write many fields that is protected by +'reconfig_mutex', and raid_resume() already grab the lock in other +contex. Hence fix this problem by protecting "pers->host_add_disk" +with the lock. + +Fixes: 9092c02d9435 ("DM RAID: Add ability to restore transiently failed devices on resume") +Fixes: a448af25becf ("md/raid10: remove rcu protection to access rdev from conf") +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-10-yukuai1@huaweicloud.com +Signed-off-by: Coly Li + +--- + drivers/md/dm-raid.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c +index ea45f777691c..17e9af60bbf7 100644 +--- a/drivers/md/dm-raid.c ++++ b/drivers/md/dm-raid.c +@@ -4091,7 +4091,9 @@ static void raid_resume(struct dm_target *ti) + * Take this opportunity to check whether any failed + * devices are reachable again. + */ ++ mddev_lock_nointr(mddev); + attempt_restore_of_faulty_devices(rs); ++ mddev_unlock(mddev); + } + + if (test_and_clear_bit(RT_FLAG_RS_SUSPENDED, &rs->runtime_flags)) { +-- +2.35.3 + diff --git a/series.conf b/series.conf index 2723f46..e8b222a 100644 --- a/series.conf +++ b/series.conf @@ -45837,6 +45837,7 @@ 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/dm-raid-fix-lockdep-waring-in-pers-hot_add_disk-9500.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