fix KASAN issue for dm-raid
cover fix KASAN issue for dm-raid
Hi,
Let's try another approach to fix the KASAN issue, and to avoid cause issue for clustered raid.
Thanks,
Guoqing
Guoqing Jiang (2):
Revert "md-raid: destroy the bitmap after destroying the thread"
md: call __md_stop_writes in md_stop
drivers/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.31.1
PATCH 2/2 md: call __md_stop_writes in md_stop
From the link [1], we can see raid1d was running even after the path raid_dtr -> md_stop -> __md_stop.
Let's stop write first in destructor to align with normal md-raid to fix the KASAN issue.
--- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/md.c +1 -0
@@ -6260,6 +6260,7 @@ void md_stop(struct mddev *mddev)/* stop the array and free an attached data structures. * This is called from dm-raid */ +__md_stop_writes (mddev);__md_stop (mddev);bioset_exit (&mddev->bio_set);bioset_exit (&mddev->sync_set);
Signature · 1 line
2.31.1
PATCH 1/2 Revert "md-raid: destroy the bitmap after destroying the thread"
In reply to Guoqing JiangThis reverts commit e151db8ecfb019b7da31d076130a794574c89f6f. Because it obviously breaks clustered raid as noticed by Neil though it fixed KASAN issue for dm-raid, let's revert it and fix KASAN issue in next commit.
[1]. https://lore.kernel.org/linux-raid/[email protected]/T/#m95ac225cab7409f66c295772483d091084a6d470
--- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
@@ -6238,11 +6238,11 @@ static void mddev_detach(struct mddev *mddev)static void __md_stop (struct mddev *mddev) {struct md_personality *pers = mddev->pers; +md_bitmap_destroy (mddev);mddev_detach (mddev);/* Ensure ->event_work is done */ if (mddev->event_work.func)flush_workqueue (md_misc_wq); -md_bitmap_destroy (mddev);spin_lock (&mddev->lock); mddev->pers =NULL ;spin_unlock (&mddev->lock);
Signature · 1 line
2.31.1
Quoted 5 lines · Guoqing Jiang
Hi,
Let's try another approach to fix the KASAN issue, and to avoid cause issue for clustered raid.
Applied to md-fixes.
Thanks,
Song
Quoted 14 lines
Thanks,
GuoqingGuoqing Jiang (2):
Revert "md-raid: destroy the bitmap after destroying the thread"
md: call__md_stop_writesinmd_stopdrivers/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)--
2.31.1