mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
dm-raid: fix lockdep waring in "pers->hot_add_disk"
The lockdep assert is added by commita448af25be
("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:9092c02d94
("DM RAID: Add ability to restore transiently failed devices on resume") Fixes:a448af25be
("md/raid10: remove rcu protection to access rdev from conf") Cc: stable@vger.kernel.org # v6.7+ Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Xiao Ni <xni@redhat.com> Acked-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20240305072306.2562024-10-yukuai1@huaweicloud.com
This commit is contained in:
parent
41425f96d7
commit
95009ae904
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user