[PATCH] gfs2: Unregister debugfs on filesystem registration failure

Haoxiang Li <[email protected]> Mon, 22 Jun 2026 18:05:12 +0800
Newsgroups dev.linux.lists.gfs2,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
init_gfs2_fs() registers debugfs before registering the GFS2
filesystems. If either filesystem registration fails, the
error path tears down the other resources but leaves debugfs
registered. Call gfs2_unregister_debugfs() from the filesystem
registration failure path.

Signed-off-by: Haoxiang Li <[email protected]>
---
 fs/gfs2/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 9d65719353fa..9fc4835f209d 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -187,6 +187,7 @@ static int __init init_gfs2_fs(void)
 fail_fs2:
 	unregister_filesystem(&gfs2_fs_type);
 fail_fs1:
+	gfs2_unregister_debugfs();
 	mempool_destroy(gfs2_page_pool);
 fail_mempool:
 	destroy_workqueue(gfs2_freeze_wq);
-- 
2.25.1