]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm raid: protect md_stop() with 'reconfig_mutex'
authorYu Kuai <yukuai3@huawei.com>
Sat, 8 Jul 2023 09:21:53 +0000 (17:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:39 +0000 (10:22 +0200)
commit4e1c1d742970d65f1551a455a780c17a61ce4251
tree36b502e00ac1a635e920afacd57d5a68cd411d24
parent0c4db5a04d4ffd9f117a413b90845e9dc734a643
dm raid: protect md_stop() with 'reconfig_mutex'

[ Upstream commit 7d5fff8982a2199d49ec067818af7d84d4f95ca0 ]

__md_stop_writes() and __md_stop() will modify many fields that are
protected by 'reconfig_mutex', and all the callers will grab
'reconfig_mutex' except for md_stop().

Also, update md_stop() to make certain 'reconfig_mutex' is held using
lockdep_assert_held().

Fixes: 9d09e663d550 ("dm: raid456 basic support")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-raid.c
drivers/md/md.c