Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719599

[PATCH 10/17] drbd: fix rmmod cleanup, remove _all_ debugfs entries

From Philipp Reisner <philipp.reisner@linbit.com>
Newsgroups linux.kernel
Subject [PATCH 10/17] drbd: fix rmmod cleanup, remove _all_ debugfs entries
Date 2017-08-24 23:30 +0200
Message-ID <ui7Rp-3tg-47@gated-at.bofh.it> (permalink)
References <ui7Rn-3tg-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 00/17] DRBD updates Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 12/17] drbd: fix potential deadlock when trying to detach during handshake Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 04/17] drbd: Send P_NEG_ACK upon write error in protocol != C Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 03/17] drbd: add explicit plugging when submitting batches Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 05/17] drbd: mark symbols static where possible Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 02/17] drbd: change list_for_each_safe to while(list_first_entry_or_null) Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
    Re: [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Jens Axboe <axboe@kernel.dk> - 2017-08-25 19:30 +0200
      Re: [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-28 15:40 +0200
        [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-28 16:00 +0200
  [PATCH 08/17] drbd: fix potential get_ldev/put_ldev refcount imbalance during attach Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 17/17] drbd: switch from kmalloc() to kmalloc_array() Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 07/17] drbd: new disk-option disable-write-same Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 15/17] drbd: move global variables to drbd namespace and make some static Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 16/17] drbd: abort drbd_start_resync if there is no connection Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 13/17] drbd: fix race between handshake and admin disconnect/down Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 10/17] drbd: fix rmmod cleanup, remove _all_ debugfs entries Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200

csiph-web