Whamcloud - gitweb
Revert "LU-8359 ldlm: Wrong evict during failover" 00/27300/2
authorOleg Drokin <oleg.drokin@intel.com>
Fri, 26 May 2017 04:00:11 +0000 (04:00 +0000)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 26 May 2017 04:00:41 +0000 (04:00 +0000)
Mike points out that this patch actaully does not fix
anything and just adds another problem instead

This reverts commit c60e949e3b9f7ff19e1a644210cc764ee150ad8b.

Change-Id: I727eaee8dace8dd429451e4b6fcefbf66b940c30
Reviewed-on: https://review.whamcloud.com/27300
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_export.h
lustre/include/obd_class.h
lustre/mdt/mdt_handler.c
lustre/ofd/ofd_obd.c
lustre/target/tgt_lastrcvd.c

index 7aa1dff..7299b68 100644 (file)
@@ -164,6 +164,7 @@ do {                                                                           \
 
 enum obd_option {
         OBD_OPT_FORCE =         0x0001,
+        OBD_OPT_FAILOVER =      0x0002,
         OBD_OPT_ABORT_RECOV =   0x0004,
 };
 
index 5ae50e0..0eb7578 100644 (file)
@@ -335,7 +335,8 @@ void class_disconnect_stale_exports(struct obd_device *,
                                     int (*test_export)(struct obd_export *));
 static inline enum obd_option exp_flags_from_obd(struct obd_device *obd)
 {
-        return ((obd->obd_force ? OBD_OPT_FORCE : 0) |
+        return ((obd->obd_fail ? OBD_OPT_FAILOVER : 0) |
+                (obd->obd_force ? OBD_OPT_FORCE : 0) |
                 (obd->obd_abort_recovery ? OBD_OPT_ABORT_RECOV : 0) |
                 0);
 }
index 61a84ce..e902a3e 100644 (file)
@@ -5499,7 +5499,7 @@ static int mdt_export_cleanup(struct obd_export *exp)
                                rc = mdt_ctxt_add_dirty_flag(&env, info, mfd);
 
                        /* Don't unlink orphan on failover umount, LU-184 */
-                       if (exp->exp_obd->obd_fail) {
+                       if (exp->exp_flags & OBD_OPT_FAILOVER) {
                                ma->ma_valid = MA_FLAGS;
                                ma->ma_attr_flags |= MDS_KEEP_ORPHAN;
                        }
@@ -5508,7 +5508,9 @@ static int mdt_export_cleanup(struct obd_export *exp)
         }
         info->mti_mdt = NULL;
         /* cleanup client slot early */
-       tgt_client_del(&env, exp);
+        /* Do not erase record for recoverable client. */
+        if (!(exp->exp_flags & OBD_OPT_FAILOVER) || exp->exp_failed)
+               tgt_client_del(&env, exp);
         lu_env_fini(&env);
 
         RETURN(rc);
index 1cc1e1d..03489fe 100644 (file)
@@ -436,7 +436,9 @@ int ofd_obd_disconnect(struct obd_export *exp)
 
        tgt_grant_discard(exp);
 
-       if (exp->exp_obd->obd_replayable) {
+       /* Do not erase record for recoverable client. */
+       if (exp->exp_obd->obd_replayable &&
+           (!exp->exp_obd->obd_fail || exp->exp_failed)) {
                rc = lu_env_init(&env, LCT_DT_THREAD);
                if (rc)
                        GOTO(out, rc);
index 3a55026..c7aecdf 100644 (file)
@@ -1079,10 +1079,6 @@ int tgt_client_del(const struct lu_env *env, struct obd_export *exp)
                RETURN(-EINVAL);
        }
 
-       /* Do not erase record for recoverable client. */
-       if (exp->exp_obd->obd_fail)
-               RETURN(0);
-
        /* XXX if lcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
        if (!strcmp((char *)ted->ted_lcd->lcd_uuid,
                    (char *)tgt->lut_obd->obd_uuid.uuid) ||
@@ -1109,6 +1105,9 @@ int tgt_client_del(const struct lu_env *env, struct obd_export *exp)
                LBUG();
        }
 
+       /* Do not erase record for recoverable client. */
+       if (exp->exp_flags & OBD_OPT_FAILOVER)
+               RETURN(0);
 
        if (OBD_FAIL_CHECK(OBD_FAIL_TGT_CLIENT_DEL))
                RETURN(0);