From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - pvscan: narrow the previous commit slightly
Date: Tue, 13 Jul 2021 21:40:11 +0000 (GMT) [thread overview]
Message-ID: <20210713214011.52CC83855037@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e33c2e032cab40cf8607afa1cb92176400d1cabd
Commit: e33c2e032cab40cf8607afa1cb92176400d1cabd
Parent: 25f0f5daac5606e557d2124c219f5bb255c5d9dc
Author: David Teigland <teigland@redhat.com>
AuthorDate: Tue Jul 13 16:26:36 2021 -0500
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Tue Jul 13 16:38:04 2021 -0500
pvscan: narrow the previous commit slightly
to avoid change to pvscan-autoactivate.sh
---
tools/pvscan.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 78cb5e764..6787c4cfc 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -1611,6 +1611,7 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv)
struct pvscan_aa_params pp = { 0 };
struct dm_list complete_vgnames;
int do_activate = arg_is_set(cmd, activate_ARG);
+ int event_activation;
int devno_args = 0;
int do_all;
int ret;
@@ -1619,6 +1620,13 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv)
cmd->check_devs_used = 0;
+ event_activation = find_config_tree_bool(cmd, global_event_activation_CFG, NULL);
+
+ if (do_activate && !event_activation) {
+ 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;
@@ -1629,17 +1637,17 @@ 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) {
if (!_pvscan_cache_all(cmd, argc, argv, &complete_vgnames))
return ECMD_FAILED;
} else {
+ if (!event_activation) {
+ /* Avoid doing anything for device removal: pvscan --cache <devno> */
+ log_verbose("Ignoring pvscan --cache because event_activation is disabled.");
+ return ECMD_PROCESSED;
+ }
if (!_pvscan_cache_args(cmd, argc, argv, &complete_vgnames))
return ECMD_FAILED;
}
reply other threads:[~2021-07-13 21:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210713214011.52CC83855037@sourceware.org \
--to=teigland@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.