Whamcloud - gitweb
LU-7975 lod: fix delayed stripe error path & Client resend
[fs/lustre-release.git] / lustre / lod / lod_object.c
index 62e8967..165d4bd 100644 (file)
@@ -3344,22 +3344,14 @@ int lod_declare_striped_object(const struct lu_env *env, struct dt_object *dt,
        int                      rc;
        ENTRY;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_ALLOC_OBDO)) {
-               /* failed to create striping, let's reset
-                * config so that others don't get confused */
-               lod_object_free_striping(env, lo);
+       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_ALLOC_OBDO))
                GOTO(out, rc = -ENOMEM);
-       }
 
        if (!dt_object_remote(next)) {
                /* choose OST and generate appropriate objects */
                rc = lod_qos_prep_create(env, lo, attr, lovea, th);
-               if (rc) {
-                       /* failed to create striping, let's reset
-                        * config so that others don't get confused */
-                       lod_object_free_striping(env, lo);
+               if (rc)
                        GOTO(out, rc);
-               }
 
                /*
                 * declare storage for striping data
@@ -3390,6 +3382,11 @@ int lod_declare_striped_object(const struct lu_env *env, struct dt_object *dt,
                rc = lod_declare_init_size(env, dt, th);
 
 out:
+       /* failed to create striping or to set initial size, let's reset
+        * config so that others don't get confused */
+       if (rc)
+               lod_object_free_striping(env, lo);
+
        RETURN(rc);
 }