[lustre-devel] [PATCH 3/7] lustre/libfs: move debugfs registration from libcfs_setup back to libcfs_init

NeilBrown neilb at suse.com
Sun Jul 29 20:49:32 PDT 2018


large memory allocations should be avoided at module-init,
but registering services is appropriate.
So move the registration of debugfs files
back into libcfs_init().
Without this, /sys/kernel/debug/lnet etc are not visible
immediately that libcfs is loaded.
No debugfs file access needs anything allocated by libcfs_setup().

Fixes: 64bf0b1a079d ("staging: lustre: refactor libcfs initialization.")
Signed-off-by: NeilBrown <neilb at suse.com>
---
 drivers/staging/lustre/lnet/libcfs/module.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c
index bfadfcfa3c44..5d2be941777e 100644
--- a/drivers/staging/lustre/lnet/libcfs/module.c
+++ b/drivers/staging/lustre/lnet/libcfs/module.c
@@ -719,10 +719,6 @@ int libcfs_setup(void)
 		goto err;
 	}
 
-	lnet_insert_debugfs(lnet_table);
-	if (!IS_ERR_OR_NULL(lnet_debugfs_root))
-		lnet_insert_debugfs_links(lnet_debugfs_symlinks);
-
 	CDEBUG(D_OTHER, "portals setup OK\n");
 out:
 	libcfs_active = 1;
@@ -743,6 +739,10 @@ static int libcfs_init(void)
 {
 	int rc;
 
+	lnet_insert_debugfs(lnet_table);
+	if (!IS_ERR_OR_NULL(lnet_debugfs_root))
+		lnet_insert_debugfs_links(lnet_debugfs_symlinks);
+
 	rc = misc_register(&libcfs_dev);
 	if (rc)
 		CERROR("misc_register: error %d\n", rc);




More information about the lustre-devel mailing list