There is a race between setting obd_fail & OBD_OPT_FAILOVER.
tgt_client_del() checks only OBD_OPT_FAILOVER,
class_disconnect_export_list() is called with flags copied
from obd, and umount can start while disconnect
is in progress.
It is better to rely only on obd_fail.
We shouldn't evict during failover at all, it should
be handled on a new server.
Such wrong evict can happen when server can't send CP AST
to the client because failover has started already.
Change-Id: I649d35d180b2239fe558b375872d3805629968a9
Seagate-bug-id: MRP-3604
Signed-off-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Reviewed-on: https://review.whamcloud.com/21114
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com>
Reviewed-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_fail ? OBD_OPT_FAILOVER : 0) |
- (obd->obd_force ? OBD_OPT_FORCE : 0) |
+ return ((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_flags & OBD_OPT_FAILOVER) {
+ if (exp->exp_obd->obd_fail) {
ma->ma_valid = MA_FLAGS;
ma->ma_attr_flags |= MDS_KEEP_ORPHAN;
}
}
info->mti_mdt = NULL;
/* cleanup client slot early */
- /* Do not erase record for recoverable client. */
- if (!(exp->exp_flags & OBD_OPT_FAILOVER) || exp->exp_failed)
- tgt_client_del(&env, exp);
+ tgt_client_del(&env, exp);
lu_env_fini(&env);
RETURN(rc);
tgt_grant_discard(exp);
- /* Do not erase record for recoverable client. */
- if (exp->exp_obd->obd_replayable &&
- (!exp->exp_obd->obd_fail || exp->exp_failed)) {
+ if (exp->exp_obd->obd_replayable) {
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);