]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvmet: exit debugfs after discovery subsystem exits
authorMohamed Khalfella <mkhalfella@purestorage.com>
Thu, 7 Aug 2025 05:35:07 +0000 (22:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:39:29 +0000 (16:39 +0200)
[ Upstream commit 80f21806b8e34ae1e24c0fc6a0f0dfd9b055e130 ]

Commit 528589947c180 ("nvmet: initialize discovery subsys after debugfs
is initialized") changed nvmet_init() to initialize nvme discovery after
"nvmet" debugfs directory is initialized. The change broke nvmet_exit()
because discovery subsystem now depends on debugfs. Debugfs should be
destroyed after discovery subsystem. Fix nvmet_exit() to do that.

Reported-by: Yi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/all/CAHj4cs96AfFQpyDKF_MdfJsnOEo=2V7dQgqjFv+k3t7H-=yGhA@mail.gmail.com/
Fixes: 528589947c180 ("nvmet: initialize discovery subsys after debugfs is initialized")
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Link: https://lore.kernel.org/r/20250807053507.2794335-1-mkhalfella@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/core.c

index b6247e4afc9cdb361ae9a98ae83467c2265a9f12..491df044635f1d66a235c0e9128500b834414d5a 100644 (file)
@@ -1994,8 +1994,8 @@ out_destroy_bvec_cache:
 static void __exit nvmet_exit(void)
 {
        nvmet_exit_configfs();
-       nvmet_exit_debugfs();
        nvmet_exit_discovery();
+       nvmet_exit_debugfs();
        ida_destroy(&cntlid_ida);
        destroy_workqueue(nvmet_wq);
        destroy_workqueue(buffered_io_wq);