Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pv_major/pv_minor selectors type mismatch #122

Closed
g0tar opened this issue Jul 29, 2023 · 1 comment
Closed

pv_major/pv_minor selectors type mismatch #122

g0tar opened this issue Jul 29, 2023 · 1 comment

Comments

@g0tar
Copy link

g0tar commented Jul 29, 2023

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?

csonto pushed a commit that referenced this issue Jul 31, 2023
We incorrectly marked pv_major and pv_minor fields as being of string
type, even though the values were already correctly handled as integers
internally. This confused -S|--select that tried to compare string
values instead of integers.

Reported here: #122
@prajnoha
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants