mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-06 00:58:48 +03:00
vdo: support lvcreate with skipped activation
Support creation of VDO LV for 'lvcreate -ky...'.
This commit is contained in:
parent
4afe872fd6
commit
419c93c873
@ -8721,6 +8721,14 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
||||
goto revert_new_lv;
|
||||
}
|
||||
lv->status &= ~LV_TEMPORARY;
|
||||
} else if (seg_is_vdo_pool(lp)) {
|
||||
lv->status |= LV_TEMPORARY;
|
||||
if (!activate_lv(cmd, lv)) {
|
||||
log_error("Aborting. Failed to activate temporary "
|
||||
"volume for VDO pool creation.");
|
||||
goto revert_new_lv;
|
||||
}
|
||||
lv->status &= ~LV_TEMPORARY;
|
||||
} else if (!lv_active_change(cmd, lv, lp->activate)) {
|
||||
log_error("Failed to activate new LV %s.", display_lvname(lv));
|
||||
goto deactivate_and_revert_new_lv;
|
||||
@ -8747,6 +8755,12 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
||||
stack;
|
||||
goto deactivate_and_revert_new_lv;
|
||||
}
|
||||
if ((lv->status & LV_ACTIVATION_SKIP) &&
|
||||
!deactivate_lv(cmd, lv)) {
|
||||
log_error("Aborting. Couldn't deactivate VDO LV %s with skipped activation.",
|
||||
display_lvname(lv));
|
||||
return NULL; /* Let's retry on error path */
|
||||
}
|
||||
} else if (seg_is_cache(lp) || (origin_lv && lv_is_cache_pool(lv))) {
|
||||
/* Finish cache conversion magic */
|
||||
if (origin_lv) {
|
||||
|
@ -79,7 +79,7 @@ not fsck -n "$DM_DEV_DIR/mapper/$vg-${lv2}"
|
||||
lvremove -ff $vg
|
||||
|
||||
|
||||
lvcreate --type vdo -L10G -V1T -n $lv1 $vg
|
||||
lvcreate --type vdo -L10G -V1T -ky -n $lv1 $vg
|
||||
lvs -a $vg
|
||||
lvremove -ff $vg
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user