int mdd_changelog_store(const struct lu_env *env, struct mdd_device *mdd,
struct llog_changelog_rec *rec, struct thandle *th)
{
...
rec->cr_hdr.lrh_type = CHANGELOG_REC;
rec->cr.cr_time = cl_time();
spin_lock(&mdd->mdd_cl.mc_lock);
/* NB: I suppose it's possible llog_add adds out of order wrt cr_index,
* but as long as the MDD transactions are ordered correctly for e.g.
* rename conflicts, I don't think this should matter. */
rec->cr.cr_index = ++mdd->mdd_cl.mc_index;
spin_unlock(&mdd->mdd_cl.mc_lock);
ctxt = llog_get_context(obd, LLOG_CHANGELOG_ORIG_CTXT);
if (ctxt == NULL)
return -ENXIO;
llog_th = thandle_get_sub(env, th, ctxt->loc_handle->lgh_obj);
if (IS_ERR(llog_th))
GOTO(out_put, rc = PTR_ERR(llog_th));
rc = llog_add(env, ctxt->loc_handle, &rec->cr_hdr, NULL, llog_th);
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36316/
Subject:
LU-11426llog: changelog records reorderingProject: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 5c5a1e9b4839c3d6a70b3b7e768944f6dc237c2e