Whamcloud - gitweb
Branch b1_4_mountconf
[fs/lustre-release.git] / lustre / obdclass / obd_mount.c
index 5da2b59..413e791 100644 (file)
@@ -685,27 +685,24 @@ static int lustre_stop_mgc(struct super_block *sb)
                 RETURN(-EBUSY); 
         }
 
+        /* MGC must always stop */
         obd->obd_force = 1;
-        /* Without the fail, we wait for locks to be dropped, so if the
-           MGS is down, we might wait for an obd timeout.  With the fail,
+        /* client_disconnect_export uses the no_recov flag to decide whether it
+           should disconnect or just invalidate.  (The MGC has no
+           recoverable data in any case.) 
+           Without no_recov, we wait for locks to be dropped, so if the
+           MGS is down, we might wait for an obd timeout.  With no-recov,
            if the MGS is up, we don't tell it we're disconnecting, so 
            we must wait until the MGS evicts the dead client before the 
            client can reconnect. So it's either slow disconnect, or a 
            slow reconnect. This could probably be fixed on the server side 
            by ignoring handle mismatches in target_handle_reconnect. */
-        if (lsi->lsi_flags & LSI_UMOUNT_FAILOVER) {
-                obd->obd_fail = 1;
-                /* client_disconnect_export uses this flag to decide whether it
-                   should disconnect or just invalidate.  (The MGC has no
-                   recoverable data in any case.) */
+        if (lsi->lsi_flags & LSI_UMOUNT_FORCE) {
+                /* FIXME maybe always set this? */
                 obd->obd_no_recov = 1;
         }
-
-        /* see ll_umount_begin 
-        obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_mdc_exp, sizeof ioc_data,
-                      &ioc_data, NULL);
-        */
-        //rc = ptlrpc_set_import_active(obd->u.cli.cl_import, 0);
+        CERROR("force:%d fail:%d no_recov:%d\n", obd->obd_force, obd->obd_fail,
+               obd->obd_no_recov);
 
         if (obd->u.cli.cl_mgc_mgsexp)
                 obd_disconnect(obd->u.cli.cl_mgc_mgsexp);
@@ -785,10 +782,7 @@ static int server_stop_servers(int lddflags, int lsiflags)
         if (obd && (!type || !type->typ_refcnt)) {
                 int err;
                 obd->obd_force = 1;
-                /* This doesn't mean much on a server obd; could probably 
-                   drop it */
-                if (lsiflags & LSI_UMOUNT_FAILOVER)
-                        obd->obd_fail = 1;
+                /* obd_fail doesn't mean much on a server obd */
                 err = class_manual_cleanup(obd);
                 if (!rc) 
                         rc = err;
@@ -1021,6 +1015,9 @@ struct lustre_sb_info *lustre_init_lsi(struct super_block *sb)
         s2lsi_nocast(sb) = lsi;
         /* we take 1 extra ref for our setup */
         atomic_set(&lsi->lsi_mounts, 1);
+
+        /* Default umount style */
+        lsi->lsi_flags = LSI_UMOUNT_FAILOVER;
         RETURN(lsi);
 }
 
@@ -1269,10 +1266,11 @@ static void server_umount_begin(struct super_block *sb)
         ENTRY;
 
         CDEBUG(D_MOUNT, "umount -f\n");
-        /* umount = force
-           umount -f = failover
+        /* umount = failover
+           umount -f = force
            no third way to do non-force, non-failover */
-        lsi->lsi_flags |= LSI_UMOUNT_FAILOVER;
+        lsi->lsi_flags &= ~LSI_UMOUNT_FAILOVER;
+        lsi->lsi_flags |= LSI_UMOUNT_FORCE;
         EXIT;
 }