There is another layout change resent case: the client's job has been
done by another client, referring lod_declare_layout_change -EALREADY
case, and it became a operation w/o transaction, so we should not do
the layout change, otherwise mdt_layout_change() will try to cancel
the granted server CR lock whose remote counterpart is still in hold
on the client, and a deadlock ensues.
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I1a63fcd56f13790c4c7ccb1087b82acba81e88d6
Reviewed-on: https://review.whamcloud.com/26730
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
if (rc)
GOTO(out_obj, rc = rc < 0 ? rc : 0);
+ /**
+ * There is another resent case: the client's job has been
+ * done by another client, referring lod_declare_layout_change
+ * -EALREADY case, and it became a operation w/o transaction,
+ * so we should not do the layout change, otherwise
+ * mdt_layout_change() will try to cancel the granted server
+ * CR lock whose remote counterpart is still in hold on the
+ * client, and a deadlock ensues.
+ */
+ rc = mdt_check_resent_lock(info, obj, lhc);
+ if (rc <= 0)
+ GOTO(out_obj, rc);
+
buf->lb_buf = NULL;
buf->lb_len = 0;
if (unlikely(req_is_replay(mdt_info_req(info)))) {