rc = ll_extent_unlock(fd, inode, lsm, LCK_GROUP,
&fd->fd_cwlockh);
}
- CDEBUG(D_INFO, "closing ino = %lu file = %p has open req = %p:%x"
- " handle="LPX64"\n",
+ CDEBUG(D_INFO, "closing ino = %lu file = %p has open req = %p, type = %x, "
+ "transno = "LPU64", handle = "LPX64"\n",
inode->i_ino, file,
och->och_mod->mod_open_req,
och->och_mod->mod_open_req->rq_type,
+ och->och_mod->mod_open_req->rq_transno,
och->och_fh.cookie);
rc = ll_close_inode_openhandle(md_exp, inode, och);
rc = ll_local_open(file, it, fd);
req = it->d.lustre.it_data;
LASSERTF(rc == 0, "rc = %d\n", rc);
- CDEBUG(D_INFO, "opening ino = %lu file = %p has open req = %p:%x"
- " handle="LPX64"\n",
+ CDEBUG(D_INFO, "opening ino = %lu file = %p has open req = %p, type = %x, "
+ "transno = "LPU64", handle = "LPX64"\n",
inode->i_ino, file, req, req->rq_type,
- fd->fd_mds_och.och_fh.cookie);
+ req->rq_transno, fd->fd_mds_och.och_fh.cookie);
if (!S_ISREG(inode->i_mode))
GOTO(out, rc);
spin_unlock(&mdt->mdt_transno_lock);
/* save transno for the commit callback */
txni->txi_transno = mti->mti_transno;
- CDEBUG(D_HA, "transno "LPD64" stopped\n", txni->txi_transno);
+ CDEBUG(D_INFO, "transno "LPD64" stopped\n", txni->txi_transno);
/*
TODO: write last_rcvd
*/
mdt->mdt_last_committed = txi->txi_transno;
ptlrpc_commit_replies(obd);
}
- CDEBUG(D_HA, "%s: transno "LPD64" committed\n",
+ CDEBUG(D_INFO, "%s: transno "LPD64" committed\n",
obd->obd_name, txi->txi_transno);
return 0;
libcfs_nid2str(exp->exp_connection->c_peer.nid),
info->mti_transno, rc);
}
- CDEBUG(D_HA, "last_transno = %llu, last_committed = %llu\n",
+ CDEBUG(D_INFO, "last_transno = %llu, last_committed = %llu\n",
last_transno, last_committed);
req->rq_repmsg->transno = req->rq_transno = last_transno;
RETURN(-EFAULT);
rep->lock_policy_res2 = mdt_reint_internal(info, opc);
intent_set_disposition(rep, DISP_IT_EXECD);
+
mdt_update_last_transno(info, rep->lock_policy_res2);
RETURN(ELDLM_LOCK_ABORTED);
/*mds_deny_write_access*/
}
+ /* (1) client wants transno when open to keep a ref count for replay;
+ * see after_reply() and mdc_close_commit();
+ * (2) we need to record the transaction related stuff onto disk;
+ * But, question is: when do a rean only open, do we still need transno?
+ */
+ if (1) {
+ struct txn_param txn;
+ struct thandle *th;
+ struct dt_device *dt = info->mti_mdt->mdt_bottom;
+ txn.tp_credits = 1;
+
+ LASSERT(dt);
+ th = dt->dd_ops->dt_trans_start(info->mti_ctxt, dt, &txn);
+ if (!IS_ERR(th))
+ dt->dd_ops->dt_trans_stop(info->mti_ctxt, th);
+ else
+ RETURN(PTR_ERR(th));
+ }
+
mfd = mdt_mfd_new();
if (mfd != NULL) {
/* keep a reference on this object for this open,
}
/* Store transno in reqmsg for replay. */
- CDEBUG(D_INFO, "req->replayable = %d, transno = "LPU64
- " committed = "LPU64"\n",
- req->rq_import->imp_replayable,
- req->rq_repmsg->transno,
- req->rq_repmsg->last_committed);
+ CDEBUG(D_INFO, "req@%p: replayable = %d, transno = "LPU64
+ " committed = "LPU64"\n",
+ req,
+ req->rq_import->imp_replayable,
+ req->rq_repmsg->transno,
+ req->rq_repmsg->last_committed);
req->rq_reqmsg->transno = req->rq_transno = req->rq_repmsg->transno;
if (req->rq_import->imp_replayable) {