]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md: call __md_stop_writes in md_stop
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Wed, 17 Aug 2022 12:05:14 +0000 (20:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:18:18 +0000 (17:18 +0200)
commitf42a9819ba84bed2e609a4dff56af37063dcabdc
tree531748686ed075179263ffb1c001a60a41f3b2f8
parent4d83d9b7d5ddbbabfd62af393a02c40ddd2a03db
md: call __md_stop_writes in md_stop

commit 0dd84b319352bb8ba64752d4e45396d8b13e6018 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: 48df498daf62 ("md: move bitmap_destroy to the beginning of __md_stop")
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c