From: Guoqing Jiang Date: Wed, 17 Aug 2022 12:05:13 +0000 (+0800) Subject: Revert "md-raid: destroy the bitmap after destroying the thread" X-Git-Tag: baikal/aarch64/sdk6.1~3193^2^2~1 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=a09643da05b6447fc7030dde0e2453b674cf98c0;p=kernel.git Revert "md-raid: destroy the bitmap after destroying the thread" This reverts commit 8d276a45d5cc77f6944b9dd4ec0b4135d083f77f. 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/a6657e08-b6a7-358b-2d2a-0ac37d49d23a@linux.dev/T/#m95ac225cab7409f66c295772483d091084a6d470 Fixes: 8d276a45d5cc ("md-raid: destroy the bitmap after destroying the thread") Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 71d221601bf80..107c4c953c35a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6239,11 +6239,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);