[linux-lvm] lvm filter regex format

Joe Thornber thornber at redhat.com
Mon Dec 18 17:49:15 UTC 2017


On Mon, Dec 18, 2017 at 05:16:14PM +0000, Thanos Makatos wrote:
> I'm trying to be very specific in the global_filter of lvm.conf and
> ignore devices under /dev/mapper of the format
> '^/dev/mapper/[a-z0-9]{14}$', however the repetition count '{14}' does
> not seem to be honored?
> 
> Currently I have to repeat '[a-z0-9]' fourteen times, which works but
> it's a bit ugly.
> 
> Does the filter use some standarized regex format?

It's a custom engine that I wrote which matches all the regexs in the
filters at the same time (so is pretty fast).  Looking at the header here:

   https://github.com/jthornber/lvm2-ejt/blob/master/libdm/regex/parse_rx.h

It seems to support just catenation, |, *, +, ?, [<charset>], ^ and $

Out of interest why are you using the length of the device name as a discriminator?

- Joe




More information about the linux-lvm mailing list