struct layout_intent *layout,
const struct lu_buf *buf)
{
- CDEBUG(D_INFO, "got layout change request from client: "
- "opc:%u flags:%#x extent[%#llx,%#llx)\n",
- layout->li_opc, layout->li_flags,
- layout->li_start, layout->li_end);
/* need instantiate objects which in the access range */
LASSERT(m->mo_ops->moo_layout_change);
return m->mo_ops->moo_layout_change(env, m, layout, buf);
end = io->u.ci_setattr.sa_attr.lvb_size;
}
+ CDEBUG(D_VFSTRACE, DFID" type %d [%llx, %llx)\n",
+ PFID(lu_object_fid(&obj->co_lu)), io->ci_type,
+ start, end);
rc = ll_layout_write_intent(inode, start, end);
io->ci_result = rc;
if (!rc)
int rc;
ENTRY;
+ CDEBUG(D_INFO, "got layout change request from client: "
+ "opc:%u flags:%#x extent[%#llx,%#llx)\n",
+ layout->li_opc, layout->li_flags,
+ layout->li_start, layout->li_end);
if (layout->li_start >= layout->li_end) {
CERROR("Recieved an invalid layout change range [%llu, %llu) "
"for "DFID"\n", layout->li_start, layout->li_end,
if (layout_change) {
struct lu_buf *buf = &info->mti_buf;
+ /**
+ * mdt_layout_change is a reint operation, when the request
+ * is resent, layout write shouldn't reprocess it again.
+ */
+ rc = mdt_check_resent(info, mdt_reconstruct_generic, lhc);
+ 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)))) {