[PATCH 1/3] md:Add a func 'dm_md_stop' for dm-raid to clear up md resources.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Because dm-raid used md driver, when stoped dm-raid it only call
md_stop. It caused some resources omited, like bitmap, mddev->bio_set.
So add a func dm_md_stop to clear up resource.

Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
 drivers/md/md.c |    9 +++++++++
 drivers/md/md.h |    1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9ab768a..574b0a8 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5306,6 +5306,15 @@ void md_stop(struct mddev *mddev)
 }
 EXPORT_SYMBOL_GPL(md_stop);
 
+void dm_md_stop(struct mddev *mddev)
+{
+	md_stop(mddev);
+	bitmap_destroy(mddev);
+	if (mddev->bio_set)
+		bioset_free(mddev->bio_set);
+}
+EXPORT_SYMBOL_GPL(dm_md_stop);
+
 static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
 {
 	int err = 0;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index af443ab..a370ece 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -621,6 +621,7 @@ extern void md_stop(struct mddev *mddev);
 extern void md_stop_writes(struct mddev *mddev);
 extern int md_rdev_init(struct md_rdev *rdev);
 extern void md_rdev_clear(struct md_rdev *rdev);
+extern void dm_md_stop(struct mddev *mddev);
 
 extern void mddev_suspend(struct mddev *mddev);
 extern void mddev_resume(struct mddev *mddev);
-- 
1.7.9.5

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux