From: Xiao Ni Date: Sat, 21 Jan 2023 01:48:10 +0000 (+0800) Subject: md: Free writes_pending in md_stop X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=07dbb13542cc022677b64acc6e0bd0d8a2cbf4dc;p=linux.git md: Free writes_pending in md_stop dm raid calls md_stop to stop the raid device. It needs to free the writes_pending here. Signed-off-by: Xiao Ni Signed-off-by: Song Liu --- diff --git a/drivers/md/md.c b/drivers/md/md.c index da6370835c477..0cf340243ddb3 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -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);