mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
thin: enforce local activation when creation new thin
As we need to check how full thin-pool is - require thin-pool is locally active.
This commit is contained in:
parent
bbef4edd06
commit
7c36d7c90c
@ -7088,18 +7088,25 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
||||
}
|
||||
|
||||
if (seg_is_thin_volume(lp)) {
|
||||
if (lv_is_new_thin_pool(pool_lv)) {
|
||||
thin_pool_was_active = lv_is_active(pool_lv);
|
||||
if (lv_is_new_thin_pool(pool_lv)) {
|
||||
if (!check_new_thin_pool(pool_lv))
|
||||
return_NULL;
|
||||
/* New pool is now inactive */
|
||||
} else if (!pool_below_threshold(first_seg(pool_lv))) {
|
||||
} else {
|
||||
if (!activate_lv_excl_local(cmd, pool_lv)) {
|
||||
log_error("Aborting. Failed to locally activate thin pool %s.",
|
||||
display_lvname(pool_lv));
|
||||
return 0;
|
||||
}
|
||||
if (!pool_below_threshold(first_seg(pool_lv))) {
|
||||
log_error("Cannot create new thin volume, free space in "
|
||||
"thin pool %s reached threshold.",
|
||||
display_lvname(pool_lv));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (seg_is_cache(lp) &&
|
||||
!wipe_cache_pool(pool_lv))
|
||||
|
Loading…
x
Reference in New Issue
Block a user