Skip to contentSkip to conversation

stable-2.02 - vgchange: don't fail monitor command if vg is exported

PATCH David Teigland 1 participant 1 message Jul 31, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5ddd1ead2dcaf9594a025a15986b8bac573c81b2
Commit:        5ddd1ead2dcaf9594a025a15986b8bac573c81b2
Parent:        b387d026bd065b99f894a5c7b67d1f0441b583f3
Author:        David Teigland <[email protected]>
AuthorDate:    Thu Jun 20 15:59:36 2019 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Wed Jul 31 13:18:58 2019 -0500

vgchange: don't fail monitor command if vg is exported

When monitoring, skip exported VGs without causing a command failure.

The lvm2-monitor service runs 'vgchange --monitor y', so any exported VG on the system would cause the service to fail.

---
 tools/vgchange.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
tools/vgchange.c +2 -0
index 24c2253..e15fca7 100644
@@ -712,6 +712,8 @@ static int _vgchange_single(struct cmd_context *cmd, const char *vg_name,
 	};
 
 	if (vg_is_exported(vg)) {
+		if (cmd->command->command_enum == vgchange_monitor_CMD)
+			return ECMD_PROCESSED;
 		log_error("Volume group \"%s\" is exported", vg_name);
 		return ECMD_FAILED;
 	}