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... */
}
reclen = llog_data_len(sizeof(*rec) + len);
- buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_big_buf, reclen);
+ buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen);
if (buf->lb_buf == NULL)
RETURN(-ENOMEM);
rec = buf->lb_buf;
mdd_changelog_clear_cb, (void *)&mcuc,
0, 0);
- if (rc < 0) {
+ if (rc == -EINVAL) {
+ CDEBUG(D_IOCTL, "%s: No changelog recnum <= %llu to clear\n",
+ mdd2obd_dev(mdd)->obd_name, (unsigned long long) endrec);
+ RETURN(-EINVAL);
+ } else if (rc < 0) {
CWARN("%s: Failure to clear the changelog for user %d: %d\n",
mdd2obd_dev(mdd)->obd_name, id, rc);
} else if (mcuc.mcuc_flush) {
mcuc.mcuc_minrec);
}
} else {
- CWARN("%s: No entry for user %d\n",
+ CDEBUG(D_IOCTL, "%s: No entry for user %d\n",
mdd2obd_dev(mdd)->obd_name, id);
rc = -ENOENT;
}
lu_buf_free(&info->mti_big_buf);
lu_buf_free(&info->mti_link_buf);
lu_buf_free(&info->mti_xattr_buf);
+ lu_buf_free(&info->mti_chlg_buf);
OBD_FREE_PTR(info);
}