mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
359291b41c
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!
16 lines
361 B
SYSTEMD
16 lines
361 B
SYSTEMD
[Unit]
|
|
Description=LVM2 PV scan on device %i
|
|
Documentation=man:pvscan(8)
|
|
DefaultDependencies=no
|
|
BindsTo=dev-block-%i.device
|
|
Requires=lvm2-lvmetad.socket
|
|
After=lvm2-lvmetad.socket
|
|
Before=shutdown.target
|
|
Conflicts=shutdown.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
ExecStart=@sbindir@/pvscan --cache --activate ay %i
|
|
ExecStop=@sbindir@/pvscan --cache %i
|