1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-23 02:05:07 +03:00

vdo: resize requires active vdopool volume

ATM kernel VDO target does not handle resize of inactive VDO LVs
so prevent users corrupting such LVs and require active such LVs.

(manually backported from commit c20f01a0cbb24e8276734a00f26a510cf6daaf21)
This commit is contained in:
Marian Csontos 2023-06-22 16:55:47 +02:00
parent a22a9aa39b
commit 7274949166

View File

@ -5190,6 +5190,16 @@ static int _lvresize_check(struct logical_volume *lv,
struct volume_group *vg = lv->vg;
struct lv_segment *seg = first_seg(lv);
if (lv_is_vdo(lv) && !lv_is_active(lv)) {
log_error("Cannot resize inactive VDO logical volume %s.", display_lvname(lv));
return 0;
}
if (lv_is_vdo_pool(lv) && !lv_is_active(lv_lock_holder(lv))) {
log_error("Cannot resize inactive VDO POOL volume %s.", display_lvname(lv));
return 0;
}
if (lv_is_external_origin(lv)) {
/*
* Since external-origin can be activated read-only,