1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

pvscan: do nothing for device removal and event_activation=0

The lvm2-pvscan service runs pvscan --cache -aay <dev> for
device addition, and pvscan --cache <dev> on device removal.
For event_activation=0, the addition does nothing.  Fix
device removal to also do nothing for event_activation=0.
Device removal was previously doing some work to process
the removal which slowed down stopping lvm2-pvscan services.
This commit is contained in:
David Teigland 2021-07-13 15:34:05 -05:00
parent f8b52f2763
commit 25f0f5daac

View File

@ -1619,12 +1619,6 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv)
cmd->check_devs_used = 0;
if (do_activate &&
!find_config_tree_bool(cmd, global_event_activation_CFG, NULL)) {
log_verbose("Ignoring pvscan --cache -aay because event_activation is disabled.");
return ECMD_PROCESSED;
}
if (arg_is_set(cmd, major_ARG) + arg_is_set(cmd, minor_ARG))
devno_args = 1;
@ -1635,6 +1629,11 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv)
do_all = !argc && !devno_args;
if (!do_all && !find_config_tree_bool(cmd, global_event_activation_CFG, NULL)) {
log_verbose("Ignoring pvscan --cache because event_activation is disabled.");
return ECMD_PROCESSED;
}
_online_dir_setup();
if (do_all) {