X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdd%2Fmdd_device.c;fp=lustre%2Fmdd%2Fmdd_device.c;h=e7923f1e2ce6f4c4cbbcc087e006393068d85b2b;hp=a83d77084d11b4791be041d389e9673554203c3c;hb=d813c75df6798efbf3228347628c0d671ca7269c;hpb=06588e4a22b0ff037eafa1eee5e22521b1626904 diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index a83d770..e7923f1 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -344,6 +344,28 @@ static int llog_changelog_cancel_cb(const struct lu_env *env, OBD_RACE(OBD_FAIL_MDS_CHANGELOG_RACE); } + /* Records folow one by one, cr_index++. We could calculate the + * last cr_index at this plain llog. And if it less then cookie endrec + * cancel the whole file. + */ + if ((LLOG_HDR_BITMAP_SIZE(llh->lgh_hdr) - hdr->lrh_index + + rec->cr.cr_index) < cl_cookie->endrec) { + int rc; + + if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_MDS_CHANGELOG_DEL))) { + if (cfs_fail_val == 0) { + cfs_fail_val = (unsigned long)llh & 0xFFFFFFFF; + OBD_RACE(OBD_FAIL_MDS_CHANGELOG_DEL); + } + } + rc = llog_destroy(env, llh); + if (!rc) { + CDEBUG(D_HA, "Changelog destroyed plain "DFID"\n", + PFID(&llh->lgh_id.lgl_oi.oi_fid)); + RETURN(LLOG_DEL_PLAIN); + } + } + /* cancel them one at a time. I suppose we could store up the cookies * and cancel them all at once; probably more efficient, but this is * done as a user call, so who cares... */