[PATCH] gfs2: Unregister debugfs on filesystem registration failure

From: Haoxiang Li

Date: Mon Jun 22 2026 - 06:05:36 EST


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 <haoxiang_li2024@xxxxxxx>
---
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