Description of problem: The seg_pe_ranges are incorrect for a RAID LV. # lvs -a -o name,seg_pe_ranges LV PE Ranges [lvol0_pmspare] /dev/sdb:129-129 r5 r5_rimage_0:0-255 r5_rimage_1:0-255 r5_rimage_2:0-255 [r5_rimage_0] /dev/sdb:1-128 [r5_rimage_1] /dev/sdc:1-128 [r5_rimage_2] /dev/sdd:2-129 [r5_rmeta_0] /dev/sdb:0-0 [r5_rmeta_1] /dev/sdc:0-0 [r5_rmeta_2] /dev/sdd:1-1 tp tp_tdata:0-255 [tp_tdata] /dev/sdb:130-385 [tp_tmeta] /dev/sde:0-0 Version-Release number of selected component (if applicable): NA How reproducible: Always Steps to Reproduce: 1. Create a raid5 LV (lvcreate --size 1G --type raid5 -n testing some_vg 2. Query LV (lvs -a -o name,seg_pe_ranges) Actual results: see above Expected results: For this specific case we would expect: r5 r5_rimage_0:0-127 r5_rimage_1:0-127 r5_rimage_2:0-127 Additional info:
LVM version: 2.02.132(2) (2015-09-22) Library version: 1.02.115-git (2015-12-14) Driver version: 4.33.0
Created attachment 1115300 [details] ouput from -vvvv I didn't have the same configuration when I collected this debug, but the issue is the same, just different values.
It's 132. Before looking at this any further, please try to reproduce on a newer release. (This code was touched in release 133 - let's at least eliminate those changes.)
[root@localhost lvm-dubstep]# /home/tasleson/projects/lvm2/tools/lvm version LVM version: 2.02.139(2)-git (2015-12-14) Library version: 1.02.115-git (2015-12-14) Driver version: 4.33.0 [root@localhost lvm-dubstep]# /home/tasleson/projects/lvm2/tools/lvm lvcreate -L1G --type raid5 -n r5 test Rounding size 1.00 GiB (256 extents) up to stripe boundary size 1.01 GiB (258 extents). Logical volume "r5" created. [root@localhost lvm-dubstep]# /home/tasleson/projects/lvm2/tools/lvm lvs -a -o name,seg_pe_ranges LV PE Ranges r5 r5_rimage_0:0-257 r5_rimage_1:0-257 r5_rimage_2:0-257 r5_rimage_3:0-257 [r5_rimage_0] /dev/sdb:1-86 [r5_rimage_1] /dev/sdc:1-86 [r5_rimage_2] /dev/sdd:1-86 [r5_rimage_3] /dev/sde:1-86 [r5_rmeta_0] /dev/sdb:0-0 [r5_rmeta_1] /dev/sdc:0-0 [r5_rmeta_2] /dev/sdd:0-0 [r5_rmeta_3] /dev/sde:0-0 Is this new enough?
It was reporting the size of the segment - which is correct for a PV but not necessarily correct when stacked over an LV. I've changed this to report the size of the LV underneath. https://www.redhat.com/archives/lvm-devel/2016-January/msg00067.html https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=a3f484f812bfb89063fbc25e378f34cacd50bf7d But I've not tested this thoroughly and perhaps there still exist some other stacks where this is wrong.
IMHO such function should always report PE ranges. Names of LV are not really PE - so the reporting function should be simply calculating join set of PE ranges (as the name of field suggest) Currently reported LV name in this field is IMHO plain bug.
(In reply to Zdenek Kabelac from comment #6) > IMHO such function should always report PE ranges. > > Names of LV are not really PE - so the reporting function should be simply > calculating join set of PE ranges (as the name of field suggest) > > Currently reported LV name in this field is IMHO plain bug. I agree with this. seg_pe_ranges = "Ranges of Physical Extents of underlying devices in command line format." Additionally, the PE Ranges when expressed as LV ranges only list those areas that are data areas which don't include the metadata area, thus it's incomplete.
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions