Whamcloud - gitweb
LU-1303 osd: zfs-osd should initialize local objects on MDS
[fs/lustre-release.git] / lustre / obdclass / obd_mount.c
index b193034..2ca91e9 100644 (file)
@@ -389,7 +389,6 @@ static int server_start_mgs(struct super_block *sb)
         struct lustre_mount_info *lmi;
         int    rc = 0;
         ENTRY;
-        LASSERT(mnt);
 
         /* It is impossible to have more than 1 MGS per node, since
            MGC wouldn't know which to connect to */
@@ -407,7 +406,8 @@ static int server_start_mgs(struct super_block *sb)
 
         if (!rc) {
                 rc = lustre_start_simple(LUSTRE_MGS_OBDNAME, LUSTRE_MGS_NAME,
-                                        LUSTRE_MGS_OBDNAME, 0, 0, 0, 0);
+                                        LUSTRE_MGS_OBDNAME, 0, 0,
+                                        lsi->lsi_osd_obdname, 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 */
@@ -635,7 +635,7 @@ static int lustre_start_mgc(struct super_block *sb)
                 /* New failover node */
                 sprintf(niduuid, "%s_%x", mgcname, i);
                 j = 0;
-                while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+               while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
                         j++;
                         rc = do_lcfg(mgcname, nid,
                                      LCFG_ADD_UUID, niduuid, 0,0,0);
@@ -1136,6 +1136,8 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt)
         struct obd_device *obd;
         struct lustre_sb_info *lsi = s2lsi(sb);
         struct config_llog_instance cfg;
+       struct lu_env env;
+       struct lu_device *dev;
         int rc;
         ENTRY;
 
@@ -1226,12 +1228,6 @@ out_mgc:
                         RETURN(-ENXIO);
                 }
 
-                if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_ABORT_RECOV) &&
-                    (OBP(obd, iocontrol))) {
-                        obd_iocontrol(OBD_IOC_ABORT_RECOVERY,
-                                      obd->obd_self_export, 0, NULL, NULL);
-                }
-
                 server_notify_target(sb, obd);
 
                 /* calculate recovery timeout, do it after lustre_process_log */
@@ -1239,6 +1235,34 @@ out_mgc:
 
                 /* log has been fully processed */
                 obd_notify(obd, NULL, OBD_NOTIFY_CONFIG, (void *)CONFIG_LOG);
+
+               /* log has been fully processed, let clients connect */
+               dev = obd->obd_lu_dev;
+               if (dev && dev->ld_ops->ldo_prepare) {
+                       rc = lu_env_init(&env, dev->ld_type->ldt_ctx_tags);
+                       if (rc == 0) {
+                               struct lu_context  session_ctx;
+
+                               lu_context_init(&session_ctx, LCT_SESSION);
+                               session_ctx.lc_thread = NULL;
+                               lu_context_enter(&session_ctx);
+                               env.le_ses = &session_ctx;
+
+                               dev->ld_ops->ldo_prepare(&env, NULL, dev);
+
+                               lu_env_fini(&env);
+                               lu_context_exit(&session_ctx);
+                               lu_context_fini(&session_ctx);
+                       }
+               }
+
+               /* abort recovery only on the complete stack:
+                * many devices can be involved */
+               if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_ABORT_RECOV) &&
+                   (OBP(obd, iocontrol))) {
+                       obd_iocontrol(OBD_IOC_ABORT_RECOVERY,
+                                     obd->obd_self_export, 0, NULL, NULL);
+               }
         }
 
         RETURN(rc);
@@ -2001,7 +2025,7 @@ static int lmd_parse_mgs(struct lustre_mount_data *lmd, char **ptr)
        int   oldlen = 0;
 
        /* Find end of nidlist */
-       while (class_parse_nid(tail, &nid, &tail) == 0) {}
+       while (class_parse_nid_quiet(tail, &nid, &tail) == 0) {}
        length = tail - *ptr;
        if (length == 0) {
                LCONSOLE_ERROR_MSG(0x159, "Can't parse NID '%s'\n", *ptr);