lvmteam / lvm2

Mirror of upstream LVM2 repository
https://gitlab.com/lvmteam/lvm2
GNU General Public License v2.0
133 stars 73 forks source link

pv_major/pv_minor selectors type mismatch #122

Closed g0tar closed 1 year ago

g0tar commented 1 year ago

Both pv_major and pv_minor are of type string, but apparently they're not treated properly in selection - they seem to be the string composed of single character with the code equal to their value. I guess this is not how it's supposed to work:

#  vgs -o +pv_major,pv_minor -S "pv_minor =~ '^"`printf "\x02"`"$'"
  VG  #PV #LV #SN Attr   VSize    VFree    Maj Min
  hdA   1   9   0 wz--n- <920.00g <713.81g 8   2
#  vgs -o +pv_major,pv_minor -S "pv_minor =~ '^"`printf "\x12"`"$'"
  VG  #PV #LV #SN Attr   VSize    VFree    Maj Min
  hdB   1   9   0 wz--n- <920.00g <695.81g 8   18

I would expect them either to be numbers (-S "pv_minor = 2") or be strings with plain values (-S "pv_minor =~ '^18$'").

As a side note - can I match the "major:minor" pair given in that format somehow?

prajnoha commented 1 year ago

Thanks for the report!

The report types for pv_major and pv_minor were incorrect, this is now fixed with: 0e9fe27

We don't report PV's major:minor as a pair, just the separate pv_major and pv_minor fields.