Merge tag 'v3.10.107' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / md / persistent-data / dm-space-map-metadata.c
index 056d09c33af14a104c8f16b95cc7c06e251f4bb0..c79d6480fbed99232648cc19e5a6bc9bd473f278 100644 (file)
@@ -679,15 +679,13 @@ int dm_sm_metadata_create(struct dm_space_map *sm,
        memcpy(&smm->sm, &bootstrap_ops, sizeof(smm->sm));
 
        r = sm_ll_new_metadata(&smm->ll, tm);
+       if (!r) {
+               r = sm_ll_extend(&smm->ll, nr_blocks);
+       }
+       memcpy(&smm->sm, &ops, sizeof(smm->sm));
        if (r)
                return r;
 
-       r = sm_ll_extend(&smm->ll, nr_blocks);
-       if (r)
-               return r;
-
-       memcpy(&smm->sm, &ops, sizeof(smm->sm));
-
        /*
         * Now we need to update the newly created data structures with the
         * allocated blocks that they were built from.