lkml.org 
[lkml]   [2017]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 10/17] drbd: fix rmmod cleanup, remove _all_ debugfs entries
Date
From: Lars Ellenberg <lars.ellenberg@linbit.com>

If there are still resources defined, but "empty", no more volumes
or connections configured, they don't hold module reference counts,
so rmmod is possible.

To avoid DRBD leftovers in debugfs, we need to call our global
drbd_debugfs_cleanup() only after all resources have been cleaned up.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 056d9ab..8b8dd82 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2420,7 +2420,6 @@ static void drbd_cleanup(void)
destroy_workqueue(retry.wq);

drbd_genl_unregister();
- drbd_debugfs_cleanup();

idr_for_each_entry(&drbd_devices, device, i)
drbd_delete_device(device);
@@ -2431,6 +2430,8 @@ static void drbd_cleanup(void)
drbd_free_resource(resource);
}

+ drbd_debugfs_cleanup();
+
drbd_destroy_mempools();
unregister_blkdev(DRBD_MAJOR, "drbd");

--
2.7.4
\
 
 \ /
  Last update: 2017-08-24 23:26    [W:0.107 / U:9.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site