md: Free writes_pending in md_stop
authorXiao Ni <xni@redhat.com>
Sat, 21 Jan 2023 01:48:10 +0000 (09:48 +0800)
committerSong Liu <song@kernel.org>
Wed, 1 Feb 2023 16:32:58 +0000 (08:32 -0800)
dm raid calls md_stop to stop the raid device. It needs to
free the writes_pending here.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md.c

index da63708..0cf3402 100644 (file)
@@ -6265,6 +6265,7 @@ void md_stop(struct mddev *mddev)
         */
        __md_stop_writes(mddev);
        __md_stop(mddev);
+       percpu_ref_exit(&mddev->writes_pending);
        percpu_ref_exit(&mddev->active_io);
        bioset_exit(&mddev->bio_set);
        bioset_exit(&mddev->sync_set);