Skip to content

Commit d31fdd5

Browse files
Guoqing Jianggregkh
authored andcommitted
md: call __md_stop_writes in md_stop
commit 0dd84b3 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3f1ba54 commit d31fdd5

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
@@ -6094,6 +6094,7 @@ void md_stop(struct mddev *mddev)
60946094
/* stop the array and free an attached data structures.
60956095
* This is called from dm-raid
60966096
*/
6097+
__md_stop_writes(mddev);
60976098
__md_stop(mddev);
60986099
bioset_exit(&mddev->bio_set);
60996100
bioset_exit(&mddev->sync_set);

0 commit comments

Comments
 (0)