From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: neilb@suse.de, mpatocka@redhat.com
Cc: song@kernel.org, linux-raid@vger.kernel.org,
Guoqing Jiang <guoqing.jiang@linux.dev>
Subject: [PATCH 2/2] md: call __md_stop_writes in md_stop
Date: Wed, 17 Aug 2022 20:05:14 +0800 [thread overview]
Message-ID: <20220817120514.5536-3-guoqing.jiang@linux.dev> (raw)
In-Reply-To: <20220817120514.5536-1-guoqing.jiang@linux.dev>
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
next prev parent reply other threads:[~2022-08-17 12:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-08-23 17:25 ` [PATCH 0/2] fix KASAN issue for dm-raid Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220817120514.5536-3-guoqing.jiang@linux.dev \
--to=guoqing.jiang@linux.dev \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=neilb@suse.de \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).