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>
enum obd_option {
OBD_OPT_FORCE = 0x0001,
+ OBD_OPT_FAILOVER = 0x0002,
OBD_OPT_ABORT_RECOV = 0x0004,
};
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);
}
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;
}
}
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);
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);
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) ||
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);