1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

pools: error path removes metadata

When pool volume is create - it has already managed to update metadata
once within lv_extend - so revert new created LV here.
This commit is contained in:
Zdenek Kabelac 2014-10-24 15:21:48 +02:00
parent dfcf03a9ce
commit 51a29e6056

View File

@ -6888,8 +6888,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
first_seg(lv)->feature_flags = lp->feature_flags;
/* TODO: some calc_policy solution for cache ? */
if (!recalculate_pool_chunk_size_with_dev_hints(lv, lp->passed_args,
THIN_CHUNK_SIZE_CALC_METHOD_GENERIC))
return_NULL;
THIN_CHUNK_SIZE_CALC_METHOD_GENERIC)) {
stack;
goto revert_new_lv;
}
} else if (seg_is_raid(lp)) {
first_seg(lv)->min_recovery_rate = lp->min_recovery_rate;
first_seg(lv)->max_recovery_rate = lp->max_recovery_rate;
@ -6900,8 +6902,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
/* FIXME: use lowwatermark via lvm.conf global for all thinpools ? */
first_seg(lv)->low_water_mark = 0;
if (!recalculate_pool_chunk_size_with_dev_hints(lv, lp->passed_args,
lp->thin_chunk_size_calc_policy))
return_NULL;
lp->thin_chunk_size_calc_policy)) {
stack;
goto revert_new_lv;
}
} else if (seg_is_thin_volume(lp)) {
pool_lv = first_seg(lv)->pool_lv;
if (!(first_seg(lv)->device_id =
@ -7007,8 +7011,14 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
/* store vg on disk(s) */
if (!vg_write(vg) || !vg_commit(vg))
if (!vg_write(vg) || !vg_commit(vg)) {
if (seg_is_pool(lp)) {
/* Pool volumes have already created metadata LV */
stack;
goto revert_new_lv;
}
return_NULL;
}
backup(vg);