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
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);
}