+ if ((rc > 0) || (rc == -ENODATA && osd->od_lma_self_repair)) {
+ handle_t *jh;
+
+ /* For the given OST-object, if it has neither LMA nor
+ * FID in XATTR_NAME_FID, then the given FID (which is
+ * contained in the @obj, from client RPC for locating
+ * the OST-object) is trusted. We use it to generate
+ * the LMA. */
+
+ LASSERT(current->journal_info == NULL);
+
+ jh = ldiskfs_journal_start_sb(osd_sb(osd),
+ osd_dto_credits_noquota[DTO_XATTR_SET]);
+ if (IS_ERR(jh)) {
+ CWARN("%s: cannot start journal for "
+ "lma_self_repair: rc = %ld\n",
+ osd_name(osd), PTR_ERR(jh));
+ RETURN(0);
+ }
+
+ rc = osd_ea_fid_set(info, inode,
+ lu_object_fid(&obj->oo_dt.do_lu),
+ fid_is_on_ost(info, osd,
+ lu_object_fid(&obj->oo_dt.do_lu),
+ OI_CHECK_FLD) ?
+ LMAC_FID_ON_OST : 0, 0);
+ if (rc != 0)
+ CWARN("%s: cannot self repair the LMA: "
+ "rc = %d\n", osd_name(osd), rc);
+ ldiskfs_journal_stop(jh);