master - help: include cmd def info in verbose output
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=db579b9e936df14edb9...
Commit: db579b9e936df14edb9c06830c21e5b5aef666a4
Parent: dece723dc72f93cb1ea9c21bd1a6518435832c88
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 3 16:17:37 2017 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 3 16:17:37 2017 -0500
help: include cmd def info in verbose output
It can sometimes be important to correlate a
command with its cmd def entry, so include
the cross reference info in help -vv output.
---
tools/lvmcmdline.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index bf7e216..bb107d4 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1830,6 +1830,11 @@ static int _usage(const char *name, int longhelp, int skip_notes)
if ((_cmdline.commands[i].cmd_flags & CMD_FLAG_SECONDARY_SYNTAX) && !show_full)
continue;
+ log_very_verbose("Command definition index %d enum %d id %s",
+ _cmdline.commands[i].command_index,
+ _cmdline.commands[i].command_enum,
+ _cmdline.commands[i].command_id);
+
print_usage(&_cmdline.commands[i], show_full, 1);
cmd = &_cmdline.commands[i];
}
7 years
master - commands: recognize ignored options
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=dece723dc72f93cb1ea...
Commit: dece723dc72f93cb1ea9c21bd1a6518435832c88
Parent: 162272e5a5ad5249c30f024c9dc69f5a1ece8fea
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 3 15:24:46 2017 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 3 15:49:24 2017 -0500
commands: recognize ignored options
---
tools/lvmcmdline.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 6f70481..bf7e216 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1154,7 +1154,7 @@ static void _set_valid_args_for_command_name(int ci)
int num_args = 0;
int opt_enum; /* foo_ARG from args.h */
int opt_syn;
- int i, ro, oo;
+ int i, ro, oo, io;
/*
* all_args is indexed by the foo_ARG enum vals
@@ -1173,6 +1173,10 @@ static void _set_valid_args_for_command_name(int ci)
opt_enum = commands[i].optional_opt_args[oo].opt;
all_args[opt_enum] = 1;
}
+ for (io = 0; io < commands[i].io_count; io++) {
+ opt_enum = commands[i].ignore_opt_args[io].opt;
+ all_args[opt_enum] = 1;
+ }
}
for (i = 0; i < ARG_COUNT; i++) {
7 years
master - commands: ignore partial option in most cases
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=162272e5a5ad5249c30...
Commit: 162272e5a5ad5249c30f024c9dc69f5a1ece8fea
Parent: 51ff707ac859b6ab1ba1bc6cc8d9ea154632f2f7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 3 14:39:35 2017 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 3 15:43:04 2017 -0500
commands: ignore partial option in most cases
These days --partial is only used with activation in
lvchange/vgchange. It probably had another meaning
at some point in history which is no longer used,
so ignore it in those cases.
When included in the OO list, the option is advertised in
help/man output, implying it is meaningful to the command,
when in fact the command never uses it.
The IO list means the option won't cause an error if it's
used, but is not displayed as an valid option for the command.
If the option is not included in either OO or IO lists,
using the option would cause a command error, which would cause
problems for anyone is using the option for historical reasons.
---
tools/command-lines.in | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 9f0fc79..a83fb43 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -196,7 +196,7 @@ OO_ALL: --commandprofile String, --config String, --debug,
OO_REPORT: --aligned, --all, --binary, --configreport ConfigReport, --foreign,
--ignorelockingfailure, --ignoreskippedcluster, --logonly,
--nameprefixes, --noheadings, --nolocking, --nosuffix,
---options String, --partial, --readonly, --reportformat ReportFmt, --rows,
+--options String, --readonly, --reportformat ReportFmt, --rows,
--select String, --separator String, --shared, --sort String,
--trustcache, --unbuffered, --units Units, --unquoted
@@ -1177,10 +1177,11 @@ lvdisplay
OO: --aligned, --all, --binary, --colon, --columns,
--configreport ConfigReport, --foreign, --history, --ignorelockingfailure,
--ignoreskippedcluster, --logonly, --maps, --noheadings,
---nosuffix, --options String, --sort String, --partial, --readonly,
+--nosuffix, --options String, --sort String, --readonly,
--reportformat ReportFmt, --segments, --select String, --separator String,
--shared, --unbuffered, --units Units
OP: VG|LV|Tag ...
+IO: --partial
ID: lvdisplay_general
---
@@ -1294,19 +1295,22 @@ DESC: Resize a pool metadata SubLV by a specified size.
lvs
OO: --history, --segments, OO_REPORT
OP: VG|LV|Tag ...
+IO: --partial
ID: lvs_general
---
lvscan
-OO: --all, --blockdevice, --ignorelockingfailure, --partial,
+OO: --all, --blockdevice, --ignorelockingfailure,
--readonly, --reportformat ReportFmt
+IO: --partial
ID: lvscan_general
lvscan --cache_long
-OO: --blockdevice, --ignorelockingfailure, --partial,
+OO: --blockdevice, --ignorelockingfailure,
--readonly, --reportformat ReportFmt
OP: LV ...
+IO: --partial
ID: lvscan_cache
---
@@ -1390,6 +1394,7 @@ ID: pvremove_general
pvs
OO: --segments, OO_REPORT
OP: PV|Tag ...
+IO: --partial
ID: pvs_general
---
@@ -1410,9 +1415,10 @@ DESC: Populate the lvmetad cache by scanning PVs.
---
vgcfgbackup
-OO: --file String, --foreign, --ignorelockingfailure, --partial, --readonly,
+OO: --file String, --foreign, --ignorelockingfailure, --readonly,
--reportformat ReportFmt
OP: VG ...
+IO: --partial
ID: vgcfgbackup_general
---
@@ -1538,9 +1544,10 @@ vgdisplay
OO: --activevolumegroups, --aligned, --binary, --colon, --columns,
--configreport ConfigReport, --foreign, --ignorelockingfailure,
--ignoreskippedcluster, --logonly, --noheadings, --nosuffix,
---options String, --partial, --readonly, --reportformat ReportFmt, --select String,
+--options String, --readonly, --reportformat ReportFmt, --select String,
--shared, --short, --separator String, --sort String, --unbuffered, --units Units
OP: VG|Tag ...
+IO: --partial
ID: vgdisplay_general
---
@@ -1642,13 +1649,15 @@ DESC: Rename a VG by specifying the VG UUID.
vgs
OO: OO_REPORT
OP: VG|Tag ...
+IO: --partial
ID: vgs_general
---
vgscan
OO: --cache_long, --ignorelockingfailure, --mknodes, --notifydbus,
---partial, --reportformat ReportFmt
+--reportformat ReportFmt
+IO: --partial
ID: vgscan_general
---
@@ -1695,6 +1704,7 @@ ID: devtypes_general
fullreport
OO: OO_REPORT
OP: VG ...
+IO: --partial
ID: fullreport_general
lastlog
7 years
master - man: fix description of --partial option
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=51ff707ac859b6ab1ba...
Commit: 51ff707ac859b6ab1ba1bc6cc8d9ea154632f2f7
Parent: e0f284d3728d3381966dd290e205951ed99e54f9
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 3 14:15:29 2017 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 3 14:15:29 2017 -0500
man: fix description of --partial option
---
tools/args.h | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/tools/args.h b/tools/args.h
index 8d6b44d..24e3918 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -1223,13 +1223,11 @@ arg(maxphysicalvolumes_ARG, 'p', "maxphysicalvolumes", uint32_VAL, 0, 0,
arg(permission_ARG, 'p', "permission", permission_VAL, 0, 0,
"Set access permission to read only \\fBr\\fP or read and write \\fBrw\\fP.\n")
-/* FIXME: I left out some of the previous description that didn't sound correct. */
-
arg(partial_ARG, 'P', "partial", 0, 0, 0,
- "When set, the tools will do their best to provide access to VGs\n"
- "that are only partially available (one or more PVs belonging\n"
- "to the VG are missing from the system). Metadata may not be\n"
- "changed with this option.\n")
+ "Commands will do their best to activate LVs with missing PV extents.\n"
+ "Missing extents may be replaced with error or zero segments\n"
+ "according to the lvm.conf missing_stripe_filler setting.\n"
+ "Metadata may not be changed with this option.\n")
/* Not used */
arg(physicalvolume_ARG, 'P', "physicalvolume", 0, 0, 0, NULL)
7 years
master - lvchange: refresh command missing activationmode option
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e0f284d3728d3381966...
Commit: e0f284d3728d3381966dd290e205951ed99e54f9
Parent: 25b5915c9b5260c59d627bd1f6db8220bd4ad61e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 3 13:44:35 2017 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 3 13:44:35 2017 -0500
lvchange: refresh command missing activationmode option
---
tools/command-lines.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 6a345f3..9f0fc79 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -281,7 +281,7 @@ ID: lvchange_activate
DESC: Activate or deactivate an LV.
lvchange --refresh VG|LV|Tag|Select ...
-OO: --partial, --poll Bool, OO_LVCHANGE
+OO: --activationmode ActivationMode, --partial, --poll Bool, OO_LVCHANGE
ID: lvchange_refresh
DESC: Reactivate an LV using the latest metadata.
7 years
master - lvchange: avoid multiple metadata updates/reloads/backups
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=25b5915c9b5260c59d6...
Commit: 25b5915c9b5260c59d627bd1f6db8220bd4ad61e
Parent: fb1f38a6f677c0127807e6ee403af21c6d6e25da
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Sat Apr 1 02:38:48 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Sat Apr 1 02:38:48 2017 +0200
lvchange: avoid multiple metadata updates/reloads/backups
_lvchange_properties_single() processes multiple command
line arguments in a loop causing metadata updates and/or
backups per argument.
Optimize to only perform one update and/or backup
(but necessary interim ones; e.g. for --resync)
per command run.
Related: rhbz1437611
---
tools/lvchange.c | 193 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 120 insertions(+), 73 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 7239f18..27b5184 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -17,8 +17,35 @@
#include "memlock.h"
+/*
+ * Passed back from callee to request caller to
+ * commit / update and reload / backup metadata.
+ *
+ * This allows for one metadata update per command run
+ * (unless mandatory interim ones in callee).
+ */
+enum metadata_request {
+ MR_COMMIT = 0x1,
+ MR_UPDATE_RELOAD = 0x2,
+ MR_BACKUP = 0x4
+};
+
+static int _vg_write_commit(const struct logical_volume *lv, const char *what)
+{
+ log_very_verbose("Updating %slogical volume %s on disk(s).",
+ what ? : "", display_lvname(lv));
+ if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
+ log_error("Failed to update %smetadata of %s on disk.",
+ what ? : "", display_lvname(lv));
+ return 0;
+ }
+
+ return 1;
+}
+
static int _lvchange_permission(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
uint32_t lv_access;
struct lvinfo info;
@@ -67,14 +94,15 @@ static int _lvchange_permission(struct cmd_context *cmd,
display_lvname(lv));
}
- if (!lv_update_and_reload(lv))
- return_0;
+ /* Request caller to update and reload metadata */
+ *mr |= MR_UPDATE_RELOAD;
return 1;
}
static int _lvchange_pool_update(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
int update = 0;
unsigned val;
@@ -110,9 +138,7 @@ static int _lvchange_pool_update(struct cmd_context *cmd,
if (!update)
return 0;
- if (!lv_update_and_reload(lv))
- return_0;
-
+ *mr |= MR_UPDATE_RELOAD;
return 1;
}
@@ -345,12 +371,8 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
if (!seg_is_raid(seg) && !seg->log_lv) {
if (lv_is_not_synced(lv)) {
lv->status &= ~LV_NOTSYNCED;
- log_very_verbose("Updating logical volume %s on disk(s).",
- display_lvname(lv));
- if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
- log_error("Failed to update metadata on disk.");
+ if (!_vg_write_commit(lv, NULL))
return 0;
- }
}
if (!_reactivate_lv(lv, active, exclusive)) {
@@ -375,8 +397,7 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
- if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
- log_error("Failed to update intermediate VG metadata on disk.");
+ if (!_vg_write_commit(lv, "intermediate")) {
if (!_reactivate_lv(lv, active, exclusive))
stack;
return 0;
@@ -426,11 +447,8 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
- if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
- log_error("Failed to update metadata on disk for %s.",
- display_lvname(lv));
+ if (!_vg_write_commit(lv, NULL))
return 0;
- }
if (!_reactivate_lv(lv, active, exclusive)) {
backup(lv->vg);
@@ -444,7 +462,9 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 1;
}
-static int _lvchange_alloc(struct cmd_context *cmd, struct logical_volume *lv)
+static int _lvchange_alloc(struct cmd_context *cmd,
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
int want_contiguous = arg_int_value(cmd, contiguous_ARG, 0);
alloc_policy_t alloc = (alloc_policy_t)
@@ -467,16 +487,16 @@ static int _lvchange_alloc(struct cmd_context *cmd, struct logical_volume *lv)
log_very_verbose("Updating logical volume %s on disk(s).", display_lvname(lv));
/* No need to suspend LV for this change */
- if (!vg_write(lv->vg) || !vg_commit(lv->vg))
- return_0;
- backup(lv->vg);
+ /* Request caller to commit+backuo metadata */
+ *mr |= (MR_COMMIT | MR_BACKUP);
return 1;
}
static int _lvchange_errorwhenfull(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
unsigned ewf = arg_int_value(cmd, errorwhenfull_ARG, 0);
@@ -491,14 +511,15 @@ static int _lvchange_errorwhenfull(struct cmd_context *cmd,
else
lv->status &= ~LV_ERROR_WHEN_FULL;
- if (!lv_update_and_reload(lv))
- return_0;
+ /* Request caller to update and reload metadata */
+ *mr |= MR_UPDATE_RELOAD;
return 1;
}
static int _lvchange_readahead(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
unsigned read_ahead = 0;
unsigned pagesize = (unsigned) lvm_getpagesize() >> SECTOR_SHIFT;
@@ -537,14 +558,15 @@ static int _lvchange_readahead(struct cmd_context *cmd,
log_verbose("Setting read ahead to %u for %s.",
read_ahead, display_lvname(lv));
- if (!lv_update_and_reload(lv))
- return_0;
+ /* Request caller to update and reload metadata */
+ *mr |= MR_UPDATE_RELOAD;
return 1;
}
static int _lvchange_persistent(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
enum activation_change activate = CHANGE_AN;
@@ -600,11 +622,8 @@ static int _lvchange_persistent(struct cmd_context *cmd,
lv->major, lv->minor, display_lvname(lv));
}
- log_very_verbose("Updating logical volume %s on disk(s).",
- display_lvname(lv));
-
- if (!vg_write(lv->vg) || !vg_commit(lv->vg))
- return_0;
+ if (!_vg_write_commit(lv, NULL))
+ return 0;
if (activate != CHANGE_AN) {
log_verbose("Re-activating logical volume %s.", display_lvname(lv));
@@ -615,12 +634,15 @@ static int _lvchange_persistent(struct cmd_context *cmd,
}
}
- backup(lv->vg);
+ /* Request caller to backup metadata */
+ *mr |= MR_BACKUP;
return 1;
}
-static int _lvchange_cache(struct cmd_context *cmd, struct logical_volume *lv)
+static int _lvchange_cache(struct cmd_context *cmd,
+ struct logical_volume *lv,
+ enum metadata_request *mr)
{
cache_metadata_format_t format;
cache_mode_t mode;
@@ -655,8 +677,8 @@ static int _lvchange_cache(struct cmd_context *cmd, struct logical_volume *lv)
!cache_set_policy(first_seg(lv), name, settings))
goto_out;
- if (!lv_update_and_reload(lv))
- goto_out;
+ /* Request caller to update and reload metadata */
+ *mr |= MR_UPDATE_RELOAD;
r = 1;
out:
@@ -666,7 +688,8 @@ out:
return r;
}
-static int _lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv, int arg)
+static int _lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv,
+ int arg, enum metadata_request *mr)
{
if (!change_tag(cmd, NULL, lv, NULL, arg))
return_0;
@@ -674,10 +697,8 @@ static int _lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv, int
log_very_verbose("Updating logical volume %s on disk(s).", display_lvname(lv));
/* No need to suspend LV for this change */
- if (!vg_write(lv->vg) || !vg_commit(lv->vg))
- return_0;
-
- backup(lv->vg);
+ /* Request caller to commit+backup metadata */
+ *mr |= (MR_COMMIT | MR_BACKUP);
return 1;
}
@@ -730,7 +751,8 @@ static int _lvchange_rebuild(struct logical_volume *lv)
return lv_raid_rebuild(lv, rebuild_pvh);
}
-static int _lvchange_writemostly(struct logical_volume *lv)
+static int _lvchange_writemostly(struct logical_volume *lv,
+ enum metadata_request *mr)
{
int pv_count, i = 0;
uint32_t s, writemostly;
@@ -847,13 +869,14 @@ static int _lvchange_writemostly(struct logical_volume *lv)
}
}
- if (!lv_update_and_reload(lv))
- return_0;
+ /* Request caller to update and reload metadata */
+ *mr |= MR_UPDATE_RELOAD;
return 1;
}
-static int _lvchange_recovery_rate(struct logical_volume *lv)
+static int _lvchange_recovery_rate(struct logical_volume *lv,
+ enum metadata_request *mr)
{
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *raid_seg = first_seg(lv);
@@ -871,13 +894,14 @@ static int _lvchange_recovery_rate(struct logical_volume *lv)
return 0;
}
- if (!lv_update_and_reload(lv))
- return_0;
+ /* Request caller to update and reload metadata */
+ *mr |= MR_UPDATE_RELOAD;
return 1;
}
-static int _lvchange_profile(struct logical_volume *lv)
+static int _lvchange_profile(struct logical_volume *lv,
+ enum metadata_request *mr)
{
const char *old_profile_name, *new_profile_name;
struct profile *new_profile;
@@ -900,15 +924,13 @@ static int _lvchange_profile(struct logical_volume *lv)
log_verbose("Changing configuration profile for LV %s: %s -> %s.",
display_lvname(lv), old_profile_name, new_profile_name);
- if (!vg_write(lv->vg) || !vg_commit(lv->vg))
- return_0;
-
- backup(lv->vg);
+ /* Request caller to commit+backup metadata */
+ *mr |= (MR_COMMIT | MR_BACKUP);
return 1;
}
-static int _lvchange_activation_skip(struct logical_volume *lv)
+static int _lvchange_activation_skip(struct logical_volume *lv, enum metadata_request *mr)
{
int skip = arg_int_value(lv->vg->cmd, setactivationskip_ARG, 0);
@@ -917,10 +939,26 @@ static int _lvchange_activation_skip(struct logical_volume *lv)
log_verbose("Changing activation skip flag to %s for LV %s.",
display_lvname(lv), skip ? "enabled" : "disabled");
- if (!vg_write(lv->vg) || !vg_commit(lv->vg))
- return_0;
+ /* Request caller to commit+backup metadata */
+ *mr |= (MR_COMMIT | MR_BACKUP);
- backup(lv->vg);
+ return 1;
+}
+
+/* Update and reload or commit and/or backup metadata for @lv as requested by @mr */
+static int _commit_update_backup(struct logical_volume *lv,
+ const enum metadata_request mr)
+{
+ if (mr & MR_UPDATE_RELOAD) {
+ if (!lv_update_and_reload(lv))
+ return_0;
+
+ } else if ((mr & MR_COMMIT) &&
+ !_vg_write_commit(lv, NULL))
+ return 0;
+
+ if (mr & MR_BACKUP)
+ backup(lv->vg);
return 1;
}
@@ -944,6 +982,7 @@ static int _lvchange_properties_single(struct cmd_context *cmd,
{
int doit = 0, docmds = 0;
int i, opt_enum;
+ enum metadata_request mr = 0;
/*
* If a persistent lv lock already exists from activation
@@ -962,6 +1001,7 @@ static int _lvchange_properties_single(struct cmd_context *cmd,
if (!arg_is_set(cmd, opt_enum))
continue;
+ /* Archive will only happen once per run */
if (!archive(lv->vg))
return_ECMD_FAILED;
@@ -969,60 +1009,60 @@ static int _lvchange_properties_single(struct cmd_context *cmd,
switch (opt_enum) {
case permission_ARG:
- doit += _lvchange_permission(cmd, lv);
+ doit += _lvchange_permission(cmd, lv, &mr);
break;
case alloc_ARG:
case contiguous_ARG:
- doit += _lvchange_alloc(cmd, lv);
+ doit += _lvchange_alloc(cmd, lv, &mr);
break;
case errorwhenfull_ARG:
- doit += _lvchange_errorwhenfull(cmd, lv);
+ doit += _lvchange_errorwhenfull(cmd, lv, &mr);
break;
case readahead_ARG:
- doit += _lvchange_readahead(cmd, lv);
+ doit += _lvchange_readahead(cmd, lv, &mr);
break;
case persistent_ARG:
- doit += _lvchange_persistent(cmd, lv);
+ doit += _lvchange_persistent(cmd, lv, &mr);
break;
case discards_ARG:
case zero_ARG:
- doit += _lvchange_pool_update(cmd, lv);
+ doit += _lvchange_pool_update(cmd, lv, &mr);
break;
case addtag_ARG:
case deltag_ARG:
- doit += _lvchange_tag(cmd, lv, opt_enum);
+ doit += _lvchange_tag(cmd, lv, opt_enum, &mr);
break;
case writemostly_ARG:
case writebehind_ARG:
- doit += _lvchange_writemostly(lv);
+ doit += _lvchange_writemostly(lv, &mr);
break;
case minrecoveryrate_ARG:
case maxrecoveryrate_ARG:
- doit += _lvchange_recovery_rate(lv);
+ doit += _lvchange_recovery_rate(lv, &mr);
break;
case profile_ARG:
case metadataprofile_ARG:
case detachprofile_ARG:
- doit += _lvchange_profile(lv);
+ doit += _lvchange_profile(lv, &mr);
break;
case setactivationskip_ARG:
- doit += _lvchange_activation_skip(lv);
+ doit += _lvchange_activation_skip(lv, &mr);
break;
case cachemode_ARG:
case cachepolicy_ARG:
case cachesettings_ARG:
- doit += _lvchange_cache(cmd, lv);
+ doit += _lvchange_cache(cmd, lv, &mr);
break;
default:
@@ -1037,6 +1077,9 @@ static int _lvchange_properties_single(struct cmd_context *cmd,
if (doit != docmds)
return_ECMD_FAILED;
+ if (!_commit_update_backup(lv, mr))
+ return_ECMD_FAILED;
+
return ECMD_PROCESSED;
}
@@ -1379,7 +1422,12 @@ static int _lvchange_persistent_single(struct cmd_context *cmd,
struct logical_volume *lv,
struct processing_handle *handle)
{
- if (!_lvchange_persistent(cmd, lv))
+ enum metadata_request mr = 0;
+
+ if (!_lvchange_persistent(cmd, lv, &mr))
+ return_ECMD_FAILED;
+
+ if (!_commit_update_backup(lv, mr))
return_ECMD_FAILED;
return ECMD_PROCESSED;
@@ -1412,4 +1460,3 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
cmd->command->command_index, cmd->command->command_id);
return ECMD_FAILED;
}
-
7 years