All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fix KASAN issue for dm-raid
@ 2022-08-17 12:05 Guoqing Jiang
  2022-08-17 12:05 ` [PATCH 1/2] Revert "md-raid: destroy the bitmap after destroying the thread" Guoqing Jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guoqing Jiang @ 2022-08-17 12:05 UTC (permalink / raw
  To: neilb, mpatocka; +Cc: song, linux-raid, Guoqing Jiang

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(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] Revert "md-raid: destroy the bitmap after destroying the thread"
  2022-08-17 12:05 [PATCH 0/2] fix KASAN issue for dm-raid Guoqing Jiang
@ 2022-08-17 12:05 ` Guoqing Jiang
  2022-08-17 12:05 ` [PATCH 2/2] md: call __md_stop_writes in md_stop Guoqing Jiang
  2022-08-23 17:25 ` [PATCH 0/2] fix KASAN issue for dm-raid Song Liu
  2 siblings, 0 replies; 4+ messages in thread
From: Guoqing Jiang @ 2022-08-17 12:05 UTC (permalink / raw
  To: neilb, mpatocka; +Cc: song, linux-raid, Guoqing Jiang

This 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/a6657e08-b6a7-358b-2d2a-0ac37d49d23a@linux.dev/T/#m95ac225cab7409f66c295772483d091084a6d470

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index afaf36b2f6ab..76acd2c72f84 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -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);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] md: call __md_stop_writes in md_stop
  2022-08-17 12:05 [PATCH 0/2] fix KASAN issue for dm-raid Guoqing Jiang
  2022-08-17 12:05 ` [PATCH 1/2] Revert "md-raid: destroy the bitmap after destroying the thread" Guoqing Jiang
@ 2022-08-17 12:05 ` Guoqing Jiang
  2022-08-23 17:25 ` [PATCH 0/2] fix KASAN issue for dm-raid Song Liu
  2 siblings, 0 replies; 4+ messages in thread
From: Guoqing Jiang @ 2022-08-17 12:05 UTC (permalink / raw
  To: neilb, mpatocka; +Cc: song, linux-raid, Guoqing Jiang

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.

[1]. https://lore.kernel.org/linux-raid/CAPhsuW5gc4AakdGNdF8ubpezAuDLFOYUO_sfMZcec6hQFm8nhg@mail.gmail.com/T/#m7f12bf90481c02c6d2da68c64aeed4779b7df74a

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
---
 drivers/md/md.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 76acd2c72f84..8b43cf328dc3 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -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);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] fix KASAN issue for dm-raid
  2022-08-17 12:05 [PATCH 0/2] fix KASAN issue for dm-raid Guoqing Jiang
  2022-08-17 12:05 ` [PATCH 1/2] Revert "md-raid: destroy the bitmap after destroying the thread" Guoqing Jiang
  2022-08-17 12:05 ` [PATCH 2/2] md: call __md_stop_writes in md_stop Guoqing Jiang
@ 2022-08-23 17:25 ` Song Liu
  2 siblings, 0 replies; 4+ messages in thread
From: Song Liu @ 2022-08-23 17:25 UTC (permalink / raw
  To: Guoqing Jiang; +Cc: NeilBrown, Mikulas Patocka, linux-raid

On Wed, Aug 17, 2022 at 5:05 AM Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
>
> 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

>
> 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(-)
>
> --
> 2.31.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-23 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-17 12:05 [PATCH 0/2] fix KASAN issue for dm-raid Guoqing Jiang
2022-08-17 12:05 ` [PATCH 1/2] Revert "md-raid: destroy the bitmap after destroying the thread" Guoqing Jiang
2022-08-17 12:05 ` [PATCH 2/2] md: call __md_stop_writes in md_stop Guoqing Jiang
2022-08-23 17:25 ` [PATCH 0/2] fix KASAN issue for dm-raid Song Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.