Skip to content

Commit 0dd84b3

Browse files
Guoqing Jiangliu-song-6
authored andcommitted
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. [1]. https://lore.kernel.org/linux-raid/CAPhsuW5gc4AakdGNdF8ubpezAuDLFOYUO_sfMZcec6hQFm8nhg@mail.gmail.com/T/#m7f12bf90481c02c6d2da68c64aeed4779b7df74a Fixes: 48df498 ("md: move bitmap_destroy to the beginning of __md_stop") Reported-by: Mikulas Patocka <[email protected]> Signed-off-by: Guoqing Jiang <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent 1d25875 commit 0dd84b3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/md.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6261,6 +6261,7 @@ void md_stop(struct mddev *mddev)
62616261
/* stop the array and free an attached data structures.
62626262
* This is called from dm-raid
62636263
*/
6264+
__md_stop_writes(mddev);
62646265
__md_stop(mddev);
62656266
bioset_exit(&mddev->bio_set);
62666267
bioset_exit(&mddev->sync_set);

0 commit comments

Comments
 (0)