From 2f5a1df42cbd5b6a10d994a80e24b8df1a62d5ee Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 26 Jun 2009 09:19:13 +0000 Subject: [PATCH] Abort if automatic metadata correction fails when reading VG to update it. --- WHATS_NEW | 2 +- tools/lvcreate.c | 2 +- tools/lvrename.c | 2 +- tools/lvresize.c | 2 +- tools/pvchange.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 82cb9b2ed..35b22d302 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,6 +1,6 @@ Version 2.02.48 - =============================== - Abort operation if automatic metadata correction in lvconvert fails. + Abort if automatic metadata correction fails when reading VG to update it. Explicitly request fallback to default major number in device mapper. Ignore suspended devices during repair. Call vgreduce --removemissing automatically to clean up bad PVs in dmeventd. diff --git a/tools/lvcreate.c b/tools/lvcreate.c index cb4ac6115..37d30c69a 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -996,7 +996,7 @@ int lvcreate(struct cmd_context *cmd, int argc, char **argv) log_verbose("Finding volume group \"%s\"", lp.vg_name); if (!(vg = vg_lock_and_read(cmd, lp.vg_name, NULL, LCK_VG_WRITE, CLUSTERED | EXPORTED_VG | LVM_WRITE, - CORRECT_INCONSISTENT))) + CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) return ECMD_FAILED; if (!_lvcreate(cmd, vg, &lp)) diff --git a/tools/lvrename.c b/tools/lvrename.c index fae82c3f8..b5d3b3832 100644 --- a/tools/lvrename.c +++ b/tools/lvrename.c @@ -104,7 +104,7 @@ int lvrename(struct cmd_context *cmd, int argc, char **argv) log_verbose("Checking for existing volume group \"%s\"", vg_name); if (!(vg = vg_lock_and_read(cmd, vg_name, NULL, LCK_VG_WRITE, CLUSTERED | EXPORTED_VG | LVM_WRITE, - CORRECT_INCONSISTENT))) + CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) return ECMD_FAILED; if (!(lvl = find_lv_in_vg(vg, lv_name_old))) { diff --git a/tools/lvresize.c b/tools/lvresize.c index 420e5708e..1c0f5707a 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -673,7 +673,7 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv) log_verbose("Finding volume group %s", lp.vg_name); if (!(vg = vg_lock_and_read(cmd, lp.vg_name, NULL, LCK_VG_WRITE, CLUSTERED | EXPORTED_VG | LVM_WRITE, - CORRECT_INCONSISTENT))) { + CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) { stack; return ECMD_FAILED; } diff --git a/tools/pvchange.c b/tools/pvchange.c index 6f90ec783..98fe2f27d 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -59,7 +59,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv, vg_name, pv_name); if (!(vg = vg_lock_and_read(cmd, vg_name, NULL, LCK_VG_WRITE, CLUSTERED | EXPORTED_VG | LVM_WRITE, - CORRECT_INCONSISTENT))) + CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) return_0; if (!(pvl = find_pv_in_vg(vg, pv_name))) {