Whamcloud - gitweb
Introduce .gitignore files.
[fs/lustre-release.git] / lustre / mdd / mdd_lov.c
index bbf079a..f9cdc02 100644 (file)
@@ -357,7 +357,7 @@ int mdd_lov_set_md(const struct lu_env *env, struct mdd_object *pobj,
 /*
  * XXX: this is for create lsm object id, which should identify the lsm object
  * unique in the whole mds, as I see. But it seems, we still not need it
- * now. Right? So just borrow the ll_fid_build_ino().
+ * now. Right? So just borrow the cl_fid_build_ino().
  */
 static obd_id mdd_lov_create_id(const struct lu_fid *fid)
 {
@@ -410,7 +410,13 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
         if (spec->no_create != 0) {
                 *lmm = (struct lov_mds_md *)spec->u.sp_ea.eadata;
                 *lmm_size = spec->u.sp_ea.eadatalen;
-                RETURN(0);
+                if (*lmm_size == lov_mds_md_size((*lmm)->lmm_stripe_count,
+                                                 (*lmm)->lmm_magic)) {
+                        RETURN(0);
+                } else {
+                        CERROR("incorrect lsm received during recovery\n");
+                        RETURN(-EPROTO);
+                }
         }
 
         if (OBD_FAIL_CHECK(OBD_FAIL_MDS_ALLOC_OBDO))
@@ -692,10 +698,6 @@ int mdd_log_op_setattr(struct obd_device *obd, __u32 uid, __u32 gid,
         if (rc < 0)
                 RETURN(rc);
 
-        rc = obd_checkmd(mds->mds_osc_exp, obd->obd_self_export, lsm);
-        if (rc)
-                GOTO(out, rc);
-
         OBD_ALLOC(lsr, sizeof(*lsr));
         if (!lsr)
                 GOTO(out, rc = -ENOMEM);
@@ -766,12 +768,6 @@ static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid,
                 GOTO(out, rc);
         }
 
-        rc = obd_checkmd(mds->mds_osc_exp, obd->obd_self_export, oinfo.oi_md);
-        if (rc) {
-                CERROR("Error revalidate lsm %p \n", oinfo.oi_md);
-                GOTO(out, rc);
-        }
-
         /* then fill oa */
         oinfo.oi_oa->o_uid = uid;
         oinfo.oi_oa->o_gid = gid;