From: Gaurav Mahajan Date: Tue, 5 Apr 2016 01:36:56 +0000 (-0400) Subject: staging: lustre: llite: Delaying creation of client side proc entries. X-Git-Tag: v4.7-rc1~90^2~390 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=46dfb5aa980272230ceee48613aba5bd79951f33;p=karo-tx-linux.git staging: lustre: 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2941 Reviewed-on: http://review.whamcloud.com/6852 Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index c04d3776a952..b0948a7b860b 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -166,12 +166,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, return -ENOMEM; } - if (llite_root) { - err = ldebugfs_register_mountpoint(llite_root, sb, dt, md); - if (err < 0) - CERROR("could not register mount in /lustre/llite\n"); - } - /* indicate the features supported by this client */ data->ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID | @@ -552,6 +546,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, kfree(data); kfree(osfs); + if (llite_root) { + err = ldebugfs_register_mountpoint(llite_root, sb, dt, md); + if (err < 0) { + CERROR("%s: could not register mount in debugfs: " + "rc = %d\n", ll_get_fsname(sb, NULL, 0), err); + err = 0; + } + } + return err; out_root: iput(root); @@ -570,7 +573,6 @@ out_md: out: kfree(data); kfree(osfs); - ldebugfs_unregister_mountpoint(sbi); return err; }