Whamcloud - gitweb
LU-2941 llite: Delaying creation of client side proc entries. 52/6852/6
authorGaurav Mahajan <gmahajan@ddn.com>
Tue, 2 Jul 2013 06:12:05 +0000 (11:42 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 17 Aug 2013 06:08:17 +0000 (06:08 +0000)
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 <gmahajan@ddn.com>
Change-Id: Id9fc9adc3ce043c691e2d26b85c4bd1917444144
Reviewed-on: http://review.whamcloud.com/6852
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
lustre/llite/llite_lib.c

index d65710d..43eb25a 100644 (file)
@@ -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;
 }