Whamcloud - gitweb
b=17758
authoryury <yury>
Fri, 5 Dec 2008 11:06:58 +0000 (11:06 +0000)
committeryury <yury>
Fri, 5 Dec 2008 11:06:58 +0000 (11:06 +0000)
r=johann,shadow

- Do NOT call server_deregister_mount() here. This leads to
  inability cleanup cleanly and free lsi and other stuff when
  mgs calls server_put_mount() in error handling case.

lustre/obdclass/obd_mount.c

index f2f4542..d240cba 100644 (file)
@@ -498,16 +498,18 @@ static int server_start_mgs(struct super_block *sb)
 
         rc = server_register_mount(LUSTRE_MGS_OBDNAME, sb, mnt);
 
-        if (!rc &&
-            ((rc = lustre_start_simple(LUSTRE_MGS_OBDNAME, LUSTRE_MGS_NAME,
-                                       LUSTRE_MGS_OBDNAME, 0, 0))))
-                server_deregister_mount(LUSTRE_MGS_OBDNAME);
+        if (!rc) {
+                rc = lustre_start_simple(LUSTRE_MGS_OBDNAME, LUSTRE_MGS_NAME,
+                                         LUSTRE_MGS_OBDNAME, 0, 0);
+                /* Do NOT call server_deregister_mount() here. This leads to
+                 * inability cleanup cleanly and free lsi and other stuff when
+                 * mgs calls server_put_mount() in error handling case. -umka */
+        }
 
         if (rc)
                 LCONSOLE_ERROR_MSG(0x15e, "Failed to start MGS '%s' (%d).  Is "
                                    "the 'mgs' module loaded?\n",
                                    LUSTRE_MGS_OBDNAME, rc);
-
         RETURN(rc);
 }
 
@@ -1112,7 +1114,9 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt)
         if (rc) {
                 CERROR("failed to start server %s: %d\n",
                        lsi->lsi_ldd->ldd_svname, rc);
-                server_deregister_mount(lsi->lsi_ldd->ldd_svname);
+                /* Do NOT call server_deregister_mount() here. This makes it
+                 * impossible to find mount later in cleanup time and leaves
+                 * @lsi and othder stuff leaked. -umka */
                 GOTO(out_mgc, rc);
         }