Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Mon, 27 Feb 2006 19:07:04 +0000 (19:07 +0000)
committernathan <nathan>
Mon, 27 Feb 2006 19:07:04 +0000 (19:07 +0000)
b=8007
change sense of umount -f for servers:
umount = failover (next mount will go into recovery)
umount -f = force (non-failover, try to clean up)

lustre/llite/llite_lib.c
lustre/mds/mds_fs.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_handler.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c

index beed138..c1ddf7e 100644 (file)
@@ -1452,6 +1452,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
         RETURN(0);
 }
 
+/* umount -f client means force down, don't save state */
 void ll_umount_begin(struct super_block *sb)
 {
         struct lustre_sb_info *lsi = s2lsi(sb);
@@ -1460,8 +1461,8 @@ void ll_umount_begin(struct super_block *sb)
         struct obd_ioctl_data ioc_data = { 0 };
         ENTRY;
 
-        /* Make the MGC not try to cancel locks */
-        lsi->lsi_flags |= LSI_UMOUNT_FAILOVER;
+        /* Tell the MGC we got umount -f */
+        lsi->lsi_flags |= LSI_UMOUNT_FORCE;
 
         CDEBUG(D_VFSTRACE, "VFS Op: superblock %p count %d active %d\n", sb,
                sb->s_count, atomic_read(&sb->s_active));
index ce2bc6e..84cdc93 100644 (file)
@@ -583,8 +583,8 @@ int mds_fs_cleanup(struct obd_device *obd)
         int rc = 0;
 
         if (obd->obd_fail)
-                CWARN("%s: shutting down for failover; client state will "
-                      "be preserved.\n", obd->obd_name);
+                LCONSOLE_WARN("%s: shutting down for failover; client state "
+                              "will be preserved.\n", obd->obd_name);
 
         class_disconnect_exports(obd); /* cleans up client info too */
         mds_server_free_data(mds);
index 49056ad..83f0ee5 100644 (file)
@@ -511,7 +511,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
         CDEBUG(D_MGC, "Enqueue for %s (res "LPX64")\n", cld->cld_logname,
                cld->cld_resid.name[0]);
                 
-        /* We can only drop this when we drop the lock */
+        /* We can only drop this config log ref when we drop the lock */
         if (config_log_get(cld))
                 RETURN(ELDLM_LOCK_ABORTED);
 
index 9e0ab34..5923980 100644 (file)
@@ -92,6 +92,7 @@ static int mgs_reconnect(struct obd_export *exp, struct obd_device *obd,
                 RETURN(-EINVAL);
 
         CERROR("Reconnect FIXME\n");
+        class_fail_export(exp);
         //rc = mds_connect_internal(exp, data);
 
         RETURN(rc);
index a240921..bc68880 100644 (file)
@@ -346,8 +346,8 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                 obd->obd_force = 1;
                                 break;
                         case 'A':
-                                LCONSOLE_WARN("Failing %s by user command\n",
-                                       obd->obd_name);
+                                LCONSOLE_WARN("Failing over %s\n", 
+                                              obd->obd_name);
                                 obd->obd_fail = 1;
                                 obd->obd_no_transno = 1;
                                 obd->obd_no_recov = 1;
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;
 }
 
index 70256c6..b59343b 100644 (file)
@@ -1671,8 +1671,8 @@ static int filter_cleanup(struct obd_device *obd)
         ENTRY;
 
         if (obd->obd_fail)
-                CERROR("%s: shutting down for failover; client state will"
-                       " be preserved.\n", obd->obd_name);
+                LCONSOLE_WARN("%s: shutting down for failover; client state "
+                              "will be preserved.\n", obd->obd_name);
 
         if (!list_empty(&obd->obd_exports)) {
                 CERROR("%s: still has clients!\n", obd->obd_name);