Skip to contentSkip to conversation

master - Drop --ignoreskippedcluster option

PATCH David Teigland 1 participant 1 message Jun 15, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=428514a07f4bd270f6a137f08be1b2818312bdbd
Commit:        428514a07f4bd270f6a137f08be1b2818312bdbd
Parent:        ccab4a1994f4218810f1a6152cf6c71caa00977e
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Jun 15 15:43:59 2018 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Jun 15 15:59:34 2018 -0500

Drop --ignoreskippedcluster option

It's no longer needed. Clustered VGs are now handled in the same way as foreign VGs, and as shared VGs that can't be accessed:

- A command processing all VGs sees a clustered VG, prints a message ("Skipping clustered VG foo."), skips it, and does not fail.

- A command where the clustered VG is explicitly named on the command line, prints a message and fails. "Cannot access clustered VG foo, see lvmlockd(8)."

The option is listed in the set of ignored options for the commands that previously accepted it. (Removing it entirely would cause commands/scripts to fail if they set it.)

---
 lib/commands/toolcontext.c                         |    1 -
 lib/commands/toolcontext.h                         |    1 -
 lib/metadata/metadata.c                            |    5 +--
 .../lvm2_activation_generator_systemd_red_hat.c    |    2 +-
 scripts/lvm2_monitoring_systemd_red_hat.service.in |    4 +-
 tools/args.h                                       |    3 +-
 tools/command-lines.in                             |   45 +++++++++++++-------
 tools/lvmcmdline.c                                 |    1 -
 tools/toollib.c                                    |   19 ++++----
 9 files changed, 44 insertions(+), 37 deletions(-)
lib/commands/toolcontext.c +0 -1
index 723f882..50474c1 100644
@@ -1762,7 +1762,6 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
 	cmd->threaded = threaded ? 1 : 0;
 	cmd->handles_missing_pvs = 0;
 	cmd->handles_unknown_segments = 0;
-	cmd->ignore_clustered_vgs = 0;
 	cmd->hosttags = 0;
 	dm_list_init(&cmd->arg_value_groups);
 	dm_list_init(&cmd->formats);
lib/commands/toolcontext.h +0 -1
index 9849e5f..2b730ea 100644
@@ -144,7 +144,6 @@ struct cmd_context {
 	unsigned report_binary_values_as_numeric:1;
 	unsigned report_mark_hidden_devices:1;
 	unsigned metadata_read_only:1;
-	unsigned ignore_clustered_vgs:1;
 	unsigned threaded:1;			/* set if running within a thread e.g. clvmd */
 	unsigned unknown_system_id:1;
 	unsigned include_historical_lvs:1;	/* also process/report/display historical LVs */
lib/metadata/metadata.c +1 -4
index 34b1ec7..0ff38a2 100644
@@ -4698,10 +4698,7 @@ static int _access_vg_clustered(struct cmd_context *cmd, const struct volume_gro
 			return 1;
 		}
 
-		if (!cmd->ignore_clustered_vgs)
-			log_error("Skipping clustered volume group %s", vg->name);
-		else
-			log_verbose("Skipping clustered volume group %s", vg->name);
+		log_verbose("Skipping clustered VG %s.", vg->name);
 		return 0;
 	}
 
scripts/lvm2_activation_generator_systemd_red_hat.c +1 -1
index 7791e64..b3d18d2 100644
@@ -175,7 +175,7 @@ static int generate_unit(struct generator *gen, int unit)
 		      "Wants=systemd-udev-settle.service\n\n" "[Service]\n", f);
 	}
 
-	fputs("ExecStart=" LVM_PATH " vgchange -aay --ignoreskippedcluster", f);
+	fputs("ExecStart=" LVM_PATH " vgchange -aay", f);
 	if (gen->cfg.sysinit_needed)
 		fputs(" --sysinit", f);
 	fputs("\nType=oneshot\n", f);
scripts/lvm2_monitoring_systemd_red_hat.service.in +2 -2
index ebc069e..4144862 100644
@@ -10,8 +10,8 @@ Conflicts=shutdown.target
 [Service]
 Type=oneshot
 Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
-ExecStart=@SBINDIR@/lvm vgchange --monitor y --ignoreskippedcluster
-ExecStop=@SBINDIR@/lvm vgchange --monitor n --ignoreskippedcluster
+ExecStart=@SBINDIR@/lvm vgchange --monitor y
+ExecStop=@SBINDIR@/lvm vgchange --monitor n
 RemainAfterExit=yes
 
 [Install]
tools/args.h +1 -2
index 2434f4b..e574bc7 100644
@@ -243,8 +243,7 @@ arg(ignoremonitoring_ARG, '\0', "ignoremonitoring", 0, 0, 0,
     "Do not use this if dmeventd is already monitoring a device.\n")
 
 arg(ignoreskippedcluster_ARG, '\0', "ignoreskippedcluster", 0, 0, 0,
-    "Use to avoid exiting with an non-zero status code if the command is run\n"
-    "without clustered locking and clustered VGs are skipped.\n")
+    "No longer used.\n")
 
 arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", 0, 0, 0,
     "Exclude unsupported configuration settings from the output. These settings are\n"
tools/command-lines.in +30 -15

214 lines not on this page · raw message

tools/lvmcmdline.c +0 -1
index 2578113..3e617c1 100644
@@ -2323,7 +2323,6 @@ static int _get_current_settings(struct cmd_context *cmd)
 		return EINVALID_CMD_LINE;
 	}
 
-	cmd->ignore_clustered_vgs = arg_is_set(cmd, ignoreskippedcluster_ARG);
 	cmd->include_foreign_vgs = arg_is_set(cmd, foreign_ARG) ? 1 : 0;
 	cmd->include_shared_vgs = arg_is_set(cmd, shared_ARG) ? 1 : 0;
 	cmd->include_historical_lvs = arg_is_set(cmd, history_ARG) ? 1 : 0;
tools/toollib.c +9 -10
index c81d1c2..ebf2509 100644
@@ -204,10 +204,15 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
 	if ((read_error & FAILED_INCONSISTENT) && (read_flags & READ_ALLOW_INCONSISTENT))
 		read_error &= ~FAILED_INCONSISTENT; /* Check for other errors */
 
-	if ((read_error & FAILED_CLUSTERED) && vg->cmd->ignore_clustered_vgs) {
-		read_error &= ~FAILED_CLUSTERED; /* Check for other errors */
-		log_verbose("Skipping volume group %s", vg_name);
-		*skip = 1;
+	if (read_error & FAILED_CLUSTERED) {
+		if (arg_vgnames && str_list_match_item(arg_vgnames, vg->name)) {
+			log_error("Cannot access clustered VG %s, see lvmlockd(8).", vg->name);
+			return 1;
+		} else {
+			log_warn("Skipping clustered VG %s.", vg_name);
+			*skip = 1;
+			return 0;
+		}
 	}
 
 	/*
@@ -254,12 +259,6 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
 		}
 	}
 
-	if (read_error == FAILED_CLUSTERED) {
-		*skip = 1;
-		stack;	/* Error already logged */
-		return 1;
-	}
-
 	if (read_error != SUCCESS) {
 		*skip = 0;
 		if (is_orphan_vg(vg_name))