diff mbox series

[4/4] Free writes_pending in md_stop

Message ID 20230118093008.67170-5-xni@redhat.com (mailing list archive)
State Mainlined, archived
Delegated to: Song Liu
Headers show
Series Change some counters to percpu type | expand

Commit Message

Xiao Ni Jan. 18, 2023, 9:30 a.m. UTC
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>
---
 drivers/md/md.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/md/md.c b/drivers/md/md.c
index b1b1d6f98247..d471fc952afa 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6266,6 +6266,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);