1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-04-01 18:50:41 +03:00

systemd: use only major:minor for pvscan in lvm2-pvscan@.service

When using filters for the pvscan --cache (the global_filter),
there's a difference between:

  pvscan --cache -aay /dev/block/<major>:<minor>

and

  pvscan --cache -aay <major>:<minor> (or --major <major> --minor <minor>)

In the first case, we need to be sure to have an exact matching line
in the filter for the device to be used, no aliases are considered
So for example even if we have accept rule for "/dev/sda" present,
this won't apply for "/dev/block/8:0" even though it's the same device!
This is because we're comparing the path used on command line directly
with the path written in the rule.

For the second one, any alias mentioned in the filter will apply
as we're comparing the major and minor pair, not looking at actual
device names - so any alias mentioned in the rules will suffice for
the filtering rule to apply.

For the global_filter to be properly used, we need to call the
second one in the lvm2-pvscan@.service - nobody is able to tell
what value of major:minor the kernel assignes next time, hence
this bug makes the use of global_filter quite unusable!
This commit is contained in:
Peter Rajnoha 2013-12-18 12:00:02 +01:00
parent 3c818c8946
commit 359291b41c
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
Use major:minor in lvm2-pvscan@.service for proper global_filter application.
Syntax and spelling fixes in some man pages.
Dependency scan counts with snapshots and external origins.
Make sure VG extent size is always greater or equal to PV phys. block size.

View File

@ -11,5 +11,5 @@ Conflicts=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@sbindir@/pvscan --cache --activate ay /dev/block/%i
ExecStart=@sbindir@/pvscan --cache --activate ay %i
ExecStop=@sbindir@/pvscan --cache %i