Commit 1302344f authored by Yu Kuai's avatar Yu Kuai Committed by Greg Kroah-Hartman
Browse files

dm-raid: fix lockdep waring in "pers->hot_add_disk"



[ Upstream commit 95009ae9 ]

The lockdep assert is added by commit a448af25 ("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: 9092c02d ("DM RAID: Add ability to restore transiently failed devices on resume")
Fixes: a448af25 ("md/raid10: remove rcu protection to access rdev from conf")
Cc: stable@vger.kernel.org # v6.7+
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarXiao Ni <xni@redhat.com>
Acked-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240305072306.2562024-10-yukuai1@huaweicloud.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b0732674
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment