From: Zdenek Kabelac Date: Mon, 11 Nov 2019 16:36:58 +0000 (+0100) Subject: lvextend: fix resizing volumes of different segtype X-Git-Tag: v2_03_07~60 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=08f36dd093c708f0d4a4edd1fd1d84e9a2316313;p=lvm2.git lvextend: fix resizing volumes of different segtype When resizing 2 volumes like thin-pool and it's metadata and they would be of a different type - command would be actually expecting both LVs being of a same segtype - and would throw an error in case they are different. This patch fixes is by setting a new segtype from last segment of 2nd. extented device. Also it fixes the possible 'percentage' extension setup that might have been used for 'primary' volume - while the 'secondary' LV always goes with direct size - as we do not support 'percentage' setup for them This affects maily usage of thin-pool where the extension of thin-pool data size may also lead to extension of metadata size. --- diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index ae103d31a..b4daa5633 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -5623,6 +5623,8 @@ static struct logical_volume *_lvresize_setup_aux(struct logical_volume *lv, struct lv_segment *mseg = last_seg(lv); lp->alloc = lv->alloc; + lp->percent = PERCENT_NONE; + lp->segtype = mseg->segtype; lp->mirrors = seg_is_mirrored(mseg) ? lv_mirror_count(lv) : 0; lp->resizefs = 0; lp->stripes = lp->mirrors ? mseg->area_count / lp->mirrors : 0;