archive mirror
 help / color / mirror / Atom feed
From: Marian Csontos <>
To: LVM general discussion and development <>,
	Gordon Messmer <>
Subject: Re: [linux-lvm] unable to exclude LVs using global_filter
Date: Tue, 2 Jan 2018 19:17:12 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 01/02/2018 04:35 PM, Gordon Messmer wrote:
> On 01/02/2018 03:03 AM, Marian Csontos wrote:
>> Filters accept any device if any of it's "names" (all symbolic links) 
>> is matched by an a pattern ("a|.*/|" in your case) and matches no 
>> previous r pattern
> I don't follow you.  The name being processed in that log *does* match a 
> previous r pattern.
I do not think that log shows what is processed. LVM displays device 
names according to different option - preferred_names it is.

If lvmetad is in use, which by default it is, run `pvscan -vvvv --cache 
$DEV_MAJOR:$DEV_MINOR` - that should be more helpful WRT which devices 
are scanned and accepted as Physical Volumes.

>> for example anything in /dev/mapper/ is accepted. 

^ THIS! In your case the /dev/mapper/vm_* link IS accepted by the 
"a|.*/|" in global_filter. And /dev/disk/by-*/* too. And maybe others...

> Yes, I'd considered that might be an issue, but that's not the block 
> device name that the logs indicate is being used.  A path that I've 
> specifically rejected is being processed.  If a second path to the block 
> device might be processed, then I can see the need to make additional 
> changes, but I can't solve that problem without understanding the basic 
> logic of the filter system.
> The documentation in lvm.conf says "The first regex in the list to match 
> the path is used, producing the 'a' or 'r' result for the device." but 
> that doesn't seem to be correct.

IMHO the documentation is confusing if not straight incorrect. I hate 
that and IMHO we should fix how the filtering works, but that would be 
an incompatible change, and those are not loved. :-(

How it actually works is: if ANY path is accepted, the device is. In 
upstream the lvm.conf also says (emphasis mine):

"When multiple path names exist for a block device, if *any path* name 
matches an 'a' pattern before an 'r' pattern, then the device is 
accepted. If all the path names match an 'r' pattern first, then the 
device is rejected."

May be we should replace the "device" in the last sentence by "path" so 
it would say:

"The first regex in the list to match the path is used, producing the 
'a' or 'r' result for *that path*."


"When multiple path names exist for a block device"

could be safely discarded - as it is true most of if not all the time 
(or replaced by "Keep in mind devices nowadays are linked from many 
places in the /dev tree, and")

So we would have the following:

"If any path name matches an 'a' pattern before an 'r' pattern, then the 
device is accepted."

I am not a native speaker, but to me that is consistent with current 
behavior which is unlikely to change. I will send a patch to see if it 
is opposed by anyone...

-- Martian

> _______________________________________________
> linux-lvm mailing list
> read the LVM HOW-TO at

  reply	other threads:[~2018-01-02 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02  6:47 [linux-lvm] unable to exclude LVs using global_filter Gordon Messmer
2018-01-02 11:03 ` Marian Csontos
2018-01-02 15:35   ` Gordon Messmer
2018-01-02 18:17     ` Marian Csontos [this message]
2018-01-02 18:43       ` Alasdair G Kergon
2018-01-02 18:47         ` Alasdair G Kergon
2018-01-02 19:16         ` Gordon Messmer
2018-01-03 21:18           ` Gordon Messmer
2018-01-11  4:51             ` Gordon Messmer
2018-01-02 18:58       ` Gordon Messmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).