Whamcloud - gitweb
land lustre part of b_hd_sec on HEAD.
[fs/lustre-release.git] / lustre / lmv / lmv_objmgr.c
index ce054c7..4c2ef10 100644 (file)
@@ -297,7 +297,9 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
         CDEBUG(D_OTHER, "get mea for "DLID4" and create lmv obj\n",
                OLID4(id));
 
-        if (!mea) {
+        md.mea = NULL;
+       
+        if (mea == NULL) {
                 __u64 valid;
                 
                 CDEBUG(D_OTHER, "mea isn't passed in, get it now\n");
@@ -308,7 +310,7 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
                 valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
 
                 rc = md_getattr(lmv->tgts[id_group(id)].ltd_exp,
-                                id, valid, mealen, &req);
+                                id, valid, NULL, 0, mealen, &req);
                 if (rc) {
                         CERROR("md_getattr() failed, error %d\n", rc);
                         GOTO(cleanup, obj = ERR_PTR(rc));
@@ -320,7 +322,7 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
                         GOTO(cleanup, obj = ERR_PTR(rc));
                 }
 
-                if (!md.mea)
+                if (md.mea == NULL)
                         GOTO(cleanup, obj = ERR_PTR(-ENODATA));
                         
                 mea = md.mea;
@@ -333,7 +335,11 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
                        OLID4(id));
                 GOTO(cleanup, obj = ERR_PTR(-ENOMEM));
         }
-        EXIT;
+       
+       if (md.mea != NULL)
+               obd_free_memmd(exp, (struct lov_stripe_md **)&md.mea);
+        
+       EXIT;
 cleanup:
         if (req)
                 ptlrpc_req_finished(req);