mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
thin: add extra protection
Check explicitely created LV already has thin segment. As currenlty it's the only user - this patch should have no impact.
This commit is contained in:
parent
d682ad619a
commit
8cbe4a171e
@ -8500,8 +8500,9 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
|||||||
}
|
}
|
||||||
if (lp->error_when_full)
|
if (lp->error_when_full)
|
||||||
lv->status |= LV_ERROR_WHEN_FULL;
|
lv->status |= LV_ERROR_WHEN_FULL;
|
||||||
} else if (pool_lv && lv_is_virtual(lv)) { /* going to be a thin volume */
|
} else if (pool_lv && lv_is_virtual(lv) && /* not yet thin LV */
|
||||||
seg = first_seg(lv);
|
(seg = first_seg(lv)) &&
|
||||||
|
seg_is_thin(seg)) { /* going to be a thin volume */
|
||||||
pool_seg = first_seg(pool_lv);
|
pool_seg = first_seg(pool_lv);
|
||||||
if (!(seg->device_id = get_free_pool_device_id(pool_seg)))
|
if (!(seg->device_id = get_free_pool_device_id(pool_seg)))
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user