For the compatible purpose, OFD has to convert the FID(IDIF)
to ost_id before reply to MDT(in ofd_create_hdl), because the
old MDT(<2.6) can not deal with IDIF, but only ostid.
Do not LASSERT for comparing OFD precreate fids with local
used FID, instead it will just return -ESTALE.
Change-Id: Ic35cca7a78bff2e4ca24f507a2c32666ab032579
Signed-off-by: Wang Di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10580
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
out:
mutex_unlock(&oseq->os_create_lock);
out_nolock:
out:
mutex_unlock(&oseq->os_create_lock);
out_nolock:
+ if (rc == 0) {
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
+ struct ofd_thread_info *info = ofd_info(tsi->tsi_env);
+ struct lu_fid *fid = &info->fti_fid;
+
+ /* For compatible purpose, it needs to convert back to
+ * OST ID before put it on wire. */
+ *fid = rep_oa->o_oi.oi_fid;
+ fid_to_ostid(fid, &rep_oa->o_oi);
+#endif
rep_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
rep_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
ofd_seq_put(tsi->tsi_env, oseq);
out_sem:
ofd_seq_put(tsi->tsi_env, oseq);
out_sem:
GOTO(out_req, rc = -EPROTO);
ostid_to_fid(fid, &body->oa.o_oi, d->opd_index);
GOTO(out_req, rc = -EPROTO);
ostid_to_fid(fid, &body->oa.o_oi, d->opd_index);
- LASSERTF(osp_fid_diff(fid, &d->opd_pre_used_fid) > 0,
- "reply fid "DFID" pre used fid "DFID"\n", PFID(fid),
- PFID(&d->opd_pre_used_fid));
+ if (osp_fid_diff(fid, &d->opd_pre_used_fid) <= 0) {
+ CERROR("%s: precreate fid "DFID" < local used fid "DFID
+ ": rc = %d\n", d->opd_obd->obd_name,
+ PFID(fid), PFID(&d->opd_pre_used_fid), -ESTALE);
+ GOTO(out_req, rc = -ESTALE);
+ }
diff = osp_fid_diff(fid, &d->opd_pre_last_created_fid);
diff = osp_fid_diff(fid, &d->opd_pre_last_created_fid);