"\t[--discards {ignore|nopassdown|passdown}]\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-k|--setactivationskip {y|n}]\n"
"\t[-K|--ignoreactivationskip] \n"
"\t[--monitor {y|n}]\n"
addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
contiguous_ARG, deltag_ARG, discards_ARG, detachprofile_ARG, force_ARG,
ignorelockingfailure_ARG, ignoremonitoring_ARG, ignoreactivationskip_ARG,
+ ignoreskippedcluster_ARG,
major_ARG, minor_ARG, monitor_ARG, minrecoveryrate_ARG, maxrecoveryrate_ARG,
noudevsync_ARG, partial_ARG, permission_ARG, persistent_ARG, poll_ARG,
profile_ARG, raidminrecoveryrate_ARG, raidmaxrecoveryrate_ARG,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-m|--maps]\n"
"\t[--nosuffix]\n"
"\t[-P|--partial] " "\n"
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[-o|--options [+]Field[,Field]]\n"
"\t[--version]" "\n"
"\t[LogicalVolume[Path] [LogicalVolume[Path]...]]\n",
- aligned_ARG, all_ARG, colon_ARG, columns_ARG,
- ignorelockingfailure_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
+ aligned_ARG, all_ARG, colon_ARG, columns_ARG, ignorelockingfailure_ARG,
+ ignoreskippedcluster_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
options_ARG, sort_ARG, partial_ARG, segments_ARG, separator_ARG,
unbuffered_ARG, units_ARG)
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[--version]" "\n"
"\t[LogicalVolume[Path] [LogicalVolume[Path]...]]\n",
- aligned_ARG, all_ARG, ignorelockingfailure_ARG, nameprefixes_ARG,
+ aligned_ARG, all_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ nameprefixes_ARG,
noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG,
rows_ARG, segments_ARG, separator_ARG, sort_ARG, trustcache_ARG,
unbuffered_ARG, units_ARG, unquoted_ARG)
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-m|--maps]\n"
"\t[--nosuffix]\n"
"\t[-s|--short]\n"
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[-o|--options [+]Field[,Field]]\n"
"\t[PhysicalVolumePath [PhysicalVolumePath...]]\n",
aligned_ARG, all_ARG, colon_ARG, columns_ARG, ignorelockingfailure_ARG,
- maps_ARG, noheadings_ARG, nosuffix_ARG, options_ARG, separator_ARG,
- short_ARG, sort_ARG, unbuffered_ARG, units_ARG)
+ ignoreskippedcluster_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
+ options_ARG, separator_ARG, short_ARG, sort_ARG, unbuffered_ARG, units_ARG)
xx(pvmove,
"Move extents from one physical volume to another",
"\t[-d|--debug]" "\n"
"\t[-h|-?|--help] " "\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[--version]\n"
"\t[PhysicalVolume [PhysicalVolume...]]\n",
- aligned_ARG, all_ARG, ignorelockingfailure_ARG, nameprefixes_ARG,
- noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG,
- rows_ARG, segments_ARG, separator_ARG, sort_ARG, trustcache_ARG,
- unbuffered_ARG, units_ARG, unquoted_ARG)
+ aligned_ARG, all_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ nameprefixes_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG,
+ partial_ARG, rows_ARG, segments_ARG, separator_ARG, sort_ARG,
+ trustcache_ARG, unbuffered_ARG, units_ARG, unquoted_ARG)
xx(pvscan,
"List all physical volumes",
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-K|--ignoreactivationskip] \n"
"\t[--monitor {y|n}]\n"
"\t[--[vg]metadatacopies #copies] " "\n"
addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, activate_ARG,
available_ARG, clustered_ARG, deltag_ARG, detachprofile_ARG,
ignoreactivationskip_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG,
+ ignoreskippedcluster_ARG,
logicalvolume_ARG, maxphysicalvolumes_ARG, monitor_ARG, noudevsync_ARG,
metadatacopies_ARG, vgmetadatacopies_ARG, partial_ARG, profile_ARG,
physicalextentsize_ARG, poll_ARG, refresh_ARG, resizeable_ARG,
"\t[-d|--debug] " "\n"
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]" "\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nosuffix]\n"
"\t[-P|--partial] " "\n"
"\t[--units hHbBsSkKmMgGtTpPeE]\n"
"\t[-d|--debug] " "\n"
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]" "\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[-o|--options [+]Field[,Field]]\n"
"\t[VolumeGroupName [VolumeGroupName...]]\n",
activevolumegroups_ARG, aligned_ARG, colon_ARG, columns_ARG,
- ignorelockingfailure_ARG, noheadings_ARG, nosuffix_ARG, options_ARG,
- partial_ARG, short_ARG, separator_ARG, sort_ARG, unbuffered_ARG, units_ARG)
+ ignorelockingfailure_ARG, ignoreskippedcluster_ARG, noheadings_ARG,
+ nosuffix_ARG, options_ARG, partial_ARG, short_ARG, separator_ARG,
+ sort_ARG, unbuffered_ARG, units_ARG)
xx(vgexport,
"Unregister volume group(s) from the system",
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[--version]\n"
"\t[VolumeGroupName [VolumeGroupName...]]\n",
- aligned_ARG, all_ARG, ignorelockingfailure_ARG, nameprefixes_ARG,
+ aligned_ARG, all_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ nameprefixes_ARG,
noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG,
rows_ARG, separator_ARG, sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG,
unquoted_ARG)
return vg_name;
}
+/*
+ * Returns 1 if VG should be ignored.
+ */
+int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *ret)
+{
+ uint32_t read_error = vg_read_error(vg);
+
+ if (!read_error)
+ return 0;
+
+ if ((read_error == FAILED_INCONSISTENT) && allow_inconsistent)
+ return 0;
+
+ if (read_error == FAILED_CLUSTERED && vg->cmd->ignore_clustered_vgs)
+ log_verbose("Skipping volume group %s", vg_name);
+ else {
+ log_error("Skipping volume group %s", vg_name);
+ *ret = ECMD_FAILED;
+ }
+
+ return 1;
+}
+
/*
* Metadata iteration functions
*/
return_ECMD_FAILED;
if (!cmd_vg_read(cmd, &cmd_vgs)) {
- free_cmd_vgs(&cmd_vgs);
- if (ret_max < ECMD_FAILED) {
- log_error("Skipping volume group %s", vgname);
- ret_max = ECMD_FAILED;
- } else
+ if (ignore_vg(cvl_vg->vg, vgname, 0, &ret_max))
stack;
+
+ free_cmd_vgs(&cmd_vgs);
continue;
}
vg_name = pv_vg_name(pv);
vg = vg_read(cmd, vg_name, NULL, 0);
- if (vg_read_error(vg)) {
+ if (ignore_vg(vg, vg_name, 0, &ret)) {
release_vg(vg);
- log_error("Skipping volume group %s", vg_name);
- return ECMD_FAILED;
+ stack;
+ return ret;
}
/*
{
struct dm_list cmd_vgs;
struct cmd_vg *cvl_vg;
- int ret = 0;
+ int ret = ECMD_PROCESSED;
log_verbose("Finding volume group \"%s\"", vg_name);
dm_list_init(&cmd_vgs);
if (!(cvl_vg = cmd_vg_add(cmd->mem, &cmd_vgs, vg_name, vgid, flags)))
- return_0;
+ return_ECMD_FAILED;
for (;;) {
if (sigint_caught()) {
stack;
break;
}
- if (!cmd_vg_read(cmd, &cmd_vgs))
+
+ if (!cmd_vg_read(cmd, &cmd_vgs)) {
/* Allow FAILED_INCONSISTENT through only for vgcfgrestore */
- if (vg_read_error(cvl_vg->vg) &&
- (!((flags & READ_ALLOW_INCONSISTENT) &&
- (vg_read_error(cvl_vg->vg) == FAILED_INCONSISTENT)))) {
- ret = ECMD_FAILED;
+ if (ignore_vg(cvl_vg->vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &ret)) {
stack;
break;
}
+ }
if (!dm_list_empty(tags) &&
/* Only process if a tag matches or it's on arg_vgnames */
goto_out;
}
vg = vg_read(cmd, sll->str, NULL, flags);
- if (vg_read_error(vg)) {
- ret_max = ECMD_FAILED;
+ if (ignore_vg(vg, sll->str, 0, &ret_max)) {
release_vg(vg);
stack;
continue;