summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2010-06-03 12:45:05 +0000
committerMilan Broz <mbroz@redhat.com>2010-06-03 12:45:05 +0000
commit31943693c7947a9a8971b48176ac7fc222d4dacc (patch)
tree0c49218d5fc84ff42a69037e7cb0a4f089f3b41e
parente9a87f2e16c37da6bfa23a9b8bcecff9012c9abe (diff)
downloadlvm2-31943693c7947a9a8971b48176ac7fc222d4dacc.tar.gz
lvm2-31943693c7947a9a8971b48176ac7fc222d4dacc.tar.xz
lvm2-31943693c7947a9a8971b48176ac7fc222d4dacc.zip
Require partial option in lvchange --refresh for partials LVs.
We must not refresh LV if some PVs are missing and partial activation was not requested. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=598886
-rw-r--r--WHATS_NEW1
-rw-r--r--test/t-activate-partial.sh2
-rw-r--r--tools/toollib.c6
3 files changed, 9 insertions, 0 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 7f760ee4..c21a32e1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.67 -
===============================
+ Require partial option in lvchange --refresh for partial LVs.
Do not fail lvm_init() if init_logging() or _init_rand() generates an errno.
Don't merge unchanged persistent cache file before dumping if tool scanned.
Fix incorrect memory pool deallocation while using vg_read for files.
diff --git a/test/t-activate-partial.sh b/test/t-activate-partial.sh
index dd978f53..f0a95c57 100644
--- a/test/t-activate-partial.sh
+++ b/test/t-activate-partial.sh
@@ -9,6 +9,8 @@ disable_dev $dev1
not vgreduce --removemissing $vg
not lvchange -v -a y $vg/mirror
lvchange -v --partial -a y $vg/mirror
+not lvchange -v --refresh $vg/mirror
+lvchange -v --refresh --partial $vg/mirror
# also check that vgchange works
vgchange -a n --partial $vg
diff --git a/tools/toollib.c b/tools/toollib.c
index 4022a328..e6791e23 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1248,6 +1248,12 @@ int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)
{
int r = 0;
+ if (!cmd->partial_activation && (lv->status & PARTIAL_LV)) {
+ log_error("Refusing refresh of partial LV %s. Use --partial to override.",
+ lv->name);
+ goto out;
+ }
+
r = suspend_lv(cmd, lv);
if (!r)
goto_out;