* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2010, 2016, Intel Corporation.
+ * Copyright (c) 2010, 2017, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
atomic_long_set(&cli->cl_unstable_count, 0);
INIT_LIST_HEAD(&cli->cl_shrink_list);
+ INIT_LIST_HEAD(&cli->cl_flight_waiters);
+ cli->cl_rpcs_in_flight = 0;
+
init_waitqueue_head(&cli->cl_destroy_waitq);
atomic_set(&cli->cl_destroy_in_flight, 0);
#ifdef ENABLE_CHECKSUM
cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_MAX;
else
cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_DEFAULT;
- }
+ }
spin_lock_init(&cli->cl_mod_rpcs_lock);
spin_lock_init(&cli->cl_mod_rpcs_hist.oh_lock);
*
* Via check OBD_CONNECT_FID, we can distinguish whether
* the OBD_CONNECT_MDS_MDS/OBD_CONNECT_MNE_SWAB is from
- * MGC or MDT. */
+ * MGC or MDT, since MGC does not use OBD_CONNECT_FID.
+ */
if (!lw_client &&
(data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
(data->ocd_connect_flags & OBD_CONNECT_FID) &&
{
struct obd_device *obd = lut->lut_obd;
struct target_distribute_txn_data *tdtd;
+ time64_t last = 0;
+ time64_t now;
repeat:
+ if (obd->obd_recovering && obd->obd_recovery_start == 0) {
+ now = ktime_get_seconds();
+ if (now - last > 600) {
+ LCONSOLE_INFO("%s: in recovery but waiting for "
+ "the first client to connect\n",
+ obd->obd_name);
+ last = now;
+ }
+ }
if (obd->obd_recovery_start != 0 && ktime_get_real_seconds() >=
(obd->obd_recovery_start + obd->obd_recovery_time_hard)) {
__u64 next_update_transno = 0;
target_process_req_flags(obd, req);
if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_LOCK_REPLAY_DONE) {
+ if (unlikely(OBD_FAIL_CHECK(OBD_FAIL_TGT_RECOVERY_REQ_RACE))) {
+ if (cfs_fail_val == 1) {
+ cfs_race_state = 1;
+ cfs_fail_val = 0;
+ wake_up(&cfs_race_waitq);
+
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(cfs_time_seconds(1));
+ }
+ }
+
/* client declares he's ready to complete recovery
* so, we put the request on th final queue */
target_request_copy_get(req);