From 6b7bf77e7925bc844af119241fe3605a95c395e8 Mon Sep 17 00:00:00 2001 From: Gaurav Mahajan Date: Tue, 2 Jul 2013 11:42:05 +0530 Subject: [PATCH] LU-2941 llite: Delaying creation of client side proc entries. In client_common_fill_super() proc entries are created before before cl_sb_init() and therefore lu_site is not allocated resulting in client crash when tried reading lu_site stats. Delaying creation of proc entries after creation of all required data structures fixed the problem. Signed-off-by: Gaurav Mahajan Change-Id: Id9fc9adc3ce043c691e2d26b85c4bd1917444144 Reviewed-on: http://review.whamcloud.com/6852 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu --- lustre/llite/llite_lib.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index d65710d..43eb25a 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -195,13 +195,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, RETURN(-ENOMEM); } - if (proc_lustre_fs_root) { - err = lprocfs_register_mountpoint(proc_lustre_fs_root, sb, - dt, md); - if (err < 0) - CERROR("could not register mount in /proc/fs/lustre\n"); - } - /* indicate the features supported by this client */ data->ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID | @@ -606,6 +599,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, OBD_FREE_PTR(data); if (osfs != NULL) OBD_FREE_PTR(osfs); + if (proc_lustre_fs_root != NULL) { + err = lprocfs_register_mountpoint(proc_lustre_fs_root, sb, + dt, md); + if (err < 0) { + CERROR("%s: could not register mount in lprocfs: " + "rc = %d\n", ll_get_fsname(sb, NULL, 0), err); + err = 0; + } + } RETURN(err); out_root: @@ -628,7 +630,6 @@ out: OBD_FREE_PTR(data); if (osfs != NULL) OBD_FREE_PTR(osfs); - lprocfs_unregister_mountpoint(sbi); return err; } -- 1.8.3.1