Whamcloud - gitweb
- in lmv_placement_policy() add missed lmv_object_put()
authoryury <yury>
Fri, 17 Nov 2006 17:28:42 +0000 (17:28 +0000)
committeryury <yury>
Fri, 17 Nov 2006 17:28:42 +0000 (17:28 +0000)
lustre/cmm/mdc_object.c
lustre/lmv/lmv_obd.c

index 9121f80..888ee34 100644 (file)
@@ -225,7 +225,6 @@ static int mdc_attr_get(const struct lu_env *env, struct md_object *mo,
         RETURN(rc);
 }
 
-
 static int mdc_object_create(const struct lu_env *env,
                              struct md_object *mo,
                              const struct md_op_spec *spec,
index 091a80b..a82b6ce 100644 (file)
@@ -764,6 +764,17 @@ static int lmv_placement_policy(struct obd_device *obd,
                         struct lu_fid *rpid;
                         int mea_idx;
 
+                        /* 
+                         * If we have this flag turned on, this means that
+                         * caller did not notice yet that dir is split. And if
+                         * see that it is split in fact - this is race, let
+                         * caller know.
+                         */
+                        if (op_data->op_bias & MDS_CHECK_SPLIT) {
+                                lmv_obj_put(obj);
+                                RETURN(-ERESTART);
+                        }
+                        
                         /*
                          * If the dir got split, alloc fid according to its
                          * hash. No matter what we create, object create should
@@ -774,16 +785,6 @@ static int lmv_placement_policy(struct obd_device *obd,
                         rpid = &obj->lo_inodes[mea_idx].li_fid;
                         *mds = obj->lo_inodes[mea_idx].li_mds;
                         lmv_obj_put(obj);
-
-                        /* 
-                         * If we have this flag turned on, this means that
-                         * caller did not notice yet that dir is split. And if
-                         * see that it is split in fact - this is race, let
-                         * caller know.
-                         */
-                        if (op_data->op_bias & MDS_CHECK_SPLIT)
-                                RETURN(-ERESTART);
-                        
                         rc = 0;
 
                         CDEBUG(D_INODE, "The obj "DFID" has been split, got MDS at "