From: Gaurav Mahajan <[email protected]>

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.

Lustre-change: http://review.whamcloud.com/6852
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2941
Signed-off-by: Gaurav Mahajan <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Emoly Liu <[email protected]>
Signed-off-by: Peng Tao <[email protected]>
Signed-off-by: Andreas Dilger <[email protected]>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 18e3db2..a64808c 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -186,13 +186,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  |
@@ -590,6 +583,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:
@@ -612,7 +614,6 @@ out:
                OBD_FREE_PTR(data);
        if (osfs != NULL)
                OBD_FREE_PTR(osfs);
-       lprocfs_unregister_mountpoint(sbi);
        return err;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to