* main - toollib: avoid repeated remove of online vg
@ 2021-12-20 15:14 Zdenek Kabelac
0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2021-12-20 15:14 UTC (permalink / raw)
To: lvm-devel
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ed1651d11f42ea7157b7b0aebf498b97e56b98aa
Commit: ed1651d11f42ea7157b7b0aebf498b97e56b98aa
Parent: 522561e64b5fe73cb9d01c2ee2d4b7624b0ddff4
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Fri Dec 17 13:18:56 2021 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Dec 20 16:13:28 2021 +0100
toollib: avoid repeated remove of online vg
Call just once unlink after every deactivation of LV from VG.
---
lib/commands/toolcontext.h | 1 +
tools/toollib.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index fb7182db6..4d7d4630d 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -202,6 +202,7 @@ struct cmd_context {
unsigned backup_disabled:1; /* skip repeated debug message */
unsigned event_activation:1; /* whether event_activation is set */
unsigned udevoutput:1;
+ unsigned online_vg_file_removed:1;
/*
* Devices and filtering.
diff --git a/tools/toollib.c b/tools/toollib.c
index 33b704134..3b3a20689 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -829,8 +829,11 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
* user may want to take charge of activation changes to the VG
* and not have the system autoactivation interfere.
*/
- if (!is_change_activating(activate) && cmd->event_activation)
+ if (!is_change_activating(activate) && cmd->event_activation &&
+ !cmd->online_vg_file_removed) {
+ cmd->online_vg_file_removed = 1;
online_vg_file_remove(lv->vg->name);
+ }
set_lv_notify(lv->vg->cmd);
@@ -2983,6 +2986,8 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
struct glv_list *glvl, *tglvl;
int do_report_ret_code = 1;
+ cmd->online_vg_file_removed = 0;
+
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_LV);
vg_uuid[0] = '\0';
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-20 15:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-20 15:14 main - toollib: avoid repeated remove of online vg Zdenek Kabelac
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.