#define OBD_FAIL_MDS_NO_LL_OPEN 0x171
#define OBD_FAIL_MDS_LL_BLOCK 0x172
#define OBD_FAIL_MDS_LOD_CREATE_PAUSE 0x173
+#define OBD_FAIL_MDS_CONNECT_VS_EVICT 0x174
/* CMD */
#define OBD_FAIL_MDS_IS_SUBDIR_NET 0x180
int tmp_exp_old_falloc;
#endif
struct ptlrpc_connection *pcon = NULL;
+ bool reconnected = false;
ENTRY;
new_mds_mds_conn = true;
}
} else {
+ if (CFS_FAIL_CHECK(OBD_FAIL_MDS_CONNECT_VS_EVICT)) {
+ class_export_get(export);
+ class_fail_export(export);
+ class_export_put(export);
+ }
rc = obd_reconnect(req->rq_svc_thread->t_env,
export, target, &cluuid, data, &client_nid);
+ if (rc == 0)
+ reconnected = true;
}
if (rc)
GOTO(out, rc);
if (export->exp_disconnected) {
spin_unlock(&export->exp_lock);
+ if (reconnected) {
+ /*
+ * for each connect called disconnect
+ * should be called to cleanup stuff
+ */
+ class_export_get(export);
+ obd_disconnect(export);
+ }
+
GOTO(out, rc = -ENODEV);
}
if (export->exp_conn_cnt >= lustre_msg_get_conn_cnt(req->rq_reqmsg)) {
if (rc)
RETURN(err_serious(rc));
+ if (CFS_FAIL_CHECK(OBD_FAIL_MDS_CONNECT_VS_EVICT)) {
+ if (strstr(tsi->tsi_exp->exp_obd->obd_name, "MDT0000") &&
+ (exp_connect_flags(tsi->tsi_exp) & OBD_CONNECT_MDS_MDS))
+ tsi->tsi_pill->rc_req->rq_no_reply = 1;
+ }
+
RETURN(rc);
}
EXPORT_SYMBOL(tgt_obd_ping);
}
run_test 152 "QoS object allocation could be awakened in case of OST failover"
+test_153() {
+#define OBD_FAIL_MDS_CONNECT_VS_EVICT 0x174
+ do_facet mds1 "$LCTL set_param fail_loc=0x174"
+ # first drop ping reply from MDS and then
+ # evict on the subsequent reconnect
+ # (see target_handle_connect)
+ sleep $((TIMEOUT + 3))
+ stop mds1
+ do_facet mds1 "$LCTL set_param fail_loc=0"
+ start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS ||
+ error "Fail to start $SINGLEMDS"
+}
+run_test 153 "evict vs reconnect race"
+
complete $SECONDS
check_and_cleanup_lustre
exit_status