struct ldlm_res_id *res_id;
struct dt_device *dt_dev = lu2dt_dev(dt->do_lu.lo_dev);
struct osp_device *osp = dt2osp_dev(dt_dev);
+ struct lu_device *top_device;
struct ptlrpc_request *req;
int rc = 0;
__u64 flags = 0;
if (IS_ERR(req))
RETURN(PTR_ERR(req));
+ /* During recovery, it needs to let OSP send enqueue
+ * without checking recoverying status, in case the
+ * other target is being recovered at the same time,
+ * and if we wait here for the import to be recovered,
+ * it might cause deadlock */
+ top_device = dt_dev->dd_lu_dev.ld_site->ls_top_dev;
+ if (top_device->ld_obd->obd_recovering)
+ req->rq_allow_replay = 1;
+
rc = ldlm_cli_enqueue(osp->opd_exp, &req, einfo, res_id,
(const union ldlm_policy_data *)policy,
&flags, NULL, 0, LVB_T_NONE, lh, 0);