diff options
author | David Teigland <teigland@redhat.com> | 2021-11-03 12:03:29 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2021-11-04 11:08:38 -0500 |
commit | d558b3ad7e6086480075b3bf750eba0ee66c78ec (patch) | |
tree | 1185d7297ed58381889384e037e4f112b7fb5f49 /udev | |
parent | 594f6ca97024fa23dfa852b6cc9da272877e1ced (diff) | |
download | lvm2-d558b3ad7e6086480075b3bf750eba0ee66c78ec.tar.gz |
vgchange -aay: optimize device scan using pvs_online files
Port the old pvscan -aay scanning optimization to vgchange -aay.
The optimization uses pvs_online files created by pvscan --cache
to derive a list of devices to use when activating a VG. This
allows autoactivation of a VG to avoid scanning all devices, and
only scan the devices used by the VG itself. The optimization is
applied internally using the device hints interface.
The new option "--autoactivation event" is given to pvscan and
vgchange commands that are called by event activation. This
informs the command that it is being used for event activation,
so that it can apply checks and optimizations that are specific
to event activation. Those include:
- skipping the command if lvm.conf event_activation=0
- checking that a VG is complete before activating it
- using pvs_online files to limit device scanning
Diffstat (limited to 'udev')
-rw-r--r-- | udev/69-dm-lvm-metad.rules.in | 2 | ||||
-rw-r--r-- | udev/69-dm-lvm.rules.in | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in index 78f506520..a2384f2af 100644 --- a/udev/69-dm-lvm-metad.rules.in +++ b/udev/69-dm-lvm-metad.rules.in @@ -121,6 +121,6 @@ LABEL="direct_pvscan" # MD | | X | X* | | # loop | | X | X* | | # other | X | | X | | X -RUN+="(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1" +RUN+="(LVM_EXEC)/lvm pvscan --cache --aay --autoactivation event --major $major --minor $minor", ENV{LVM_SCANNED}="1" LABEL="lvm_end" diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in index d6bf1e0e9..4f34b2cc2 100644 --- a/udev/69-dm-lvm.rules.in +++ b/udev/69-dm-lvm.rules.in @@ -79,8 +79,8 @@ ENV{SYSTEMD_READY}="1" # TODO: adjust the output of vgchange -aay so that # it's better suited to appearing in the journal. -IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}" -ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}" +IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}" +ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end" LABEL="lvm_end" |