mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
thin: disable extension of reduced thin with etx.origin
Since we are currently incapable of providing zeroes for reextended thin volume area, let's disable extension of such already reduce thin volumes. (in-release change)
This commit is contained in:
parent
7786443530
commit
c0bd436dcb
@ -2452,14 +2452,6 @@ int lv_add_virtual_segment(struct logical_volume *lv, uint64_t status,
|
||||
lv->le_count += extents;
|
||||
lv->size += (uint64_t) extents *lv->vg->extent_size;
|
||||
|
||||
/* Validate thin target supports bigger size of thin volume then external origin */
|
||||
if (lv_is_thin_volume(lv) && first_seg(lv)->external_lv &&
|
||||
first_seg(lv)->external_lv->size < lv->size &&
|
||||
!thin_pool_feature_supported(first_seg(lv)->pool_lv, THIN_FEATURE_EXTERNAL_ORIGIN_EXTEND)) {
|
||||
log_error("Thin target does not support external origin smaller then thin volume.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -4036,6 +4028,26 @@ static int _lvresize_check_type(struct cmd_context *cmd, const struct logical_vo
|
||||
}
|
||||
}
|
||||
|
||||
if (lv_is_thin_volume(lv) && first_seg(lv)->external_lv &&
|
||||
(lp->resize == LV_EXTEND)) {
|
||||
/*
|
||||
* TODO: currently we do not support extension of already reduced thin volume.
|
||||
* But it might be possible to create combined mapping of some part of
|
||||
* the external origin followed by zero target.
|
||||
*/
|
||||
if (first_seg(lv)->external_lv->size > lv->size) {
|
||||
log_error("Extension of reduced thin volume with external origin is unsupported.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Validate thin target supports bigger size of thin volume then external origin */
|
||||
if (first_seg(lv)->external_lv->size <= lv->size &&
|
||||
!thin_pool_feature_supported(first_seg(lv)->pool_lv, THIN_FEATURE_EXTERNAL_ORIGIN_EXTEND)) {
|
||||
log_error("Thin target does not support external origin smaller then thin volume.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,6 @@ not lvresize -L+10 $vg/$lv1
|
||||
# But reduction works
|
||||
lvresize -L-5 -f $vg/$lv1
|
||||
not lvresize -L+15 -y $vg/$lv1
|
||||
# We may size again back up to the size of external origin
|
||||
# TODO: hmm do we really want this???
|
||||
lvresize -L+5 -f $vg/$lv1
|
||||
# Try to resize again back up to the size of external origin
|
||||
# But for now we do not support zeroing for rexetended areas.
|
||||
not lvresize -L+5 -f $vg/$lv1
|
||||
|
Loading…
x
Reference in New Issue
Block a user