1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-25 21:57:45 +03:00

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
This commit is contained in:
Milan Broz 2010-06-03 12:45:05 +00:00
parent 224457fb0f
commit a9ffbb0803
3 changed files with 9 additions and 0 deletions

View File

@ -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.

View File

@ -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

View File

@ -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;