[linux-lvm] confused with lvm2 filter rules

Zdenek Kabelac zkabelac at redhat.com
Thu Jun 6 13:51:15 UTC 2019


Dne 06. 06. 19 v 15:30 Heming Zhao napsal(a):
> Hello,
> 
> the filter is:
> filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|",
> "r|/dev/fd.*|", "r|/dev/cdrom|", "a/.*/" ]
> 
> if filter doesn't contain "a/.*/":
> - pvcreate, vgcreate & vgextend use regex filter to reject the disk.
> (correct logic)
>  > if filter contains "a/.*/":
> - regex fileter pass the disk under pvcreate/vgcreate, create successfully.
> - regex filter reject the disk under vgextend. (wrong. should create
> successfuly)
> - vgextend should do the same action as pvcreate/vgcreate.

Hi

As has been said -   when you put  a|.*| as the last rule - it's doing 
something different then you may think. So please do NOT test with such filter 
(I've been even planning to add 'WARNING:' message when lvm2 would spot such 
filter....)

> log as below (with filter contain: "a/.*/"):

Not really interesting trace - the filter works correctly for this case.

The best advice is - DO NOT USE IT set this way.

Code is correct and there is no bug - it's just non-trivial to understand what 
just filter is doing. Behavior cannot be changed without causing regression 
for other users that set filters correctly.

So do you have any buggy trace for correctly set filter ?

Regards

Zdenek




More information about the linux-lvm mailing list