Skip to contentSkip to conversation

Require partial option in lvchange --refresh for partials LVs.

PATCH New Milan Broz 2 participants 2 messages Jun 2, 2010

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/1 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.

Fix https://bugzilla.redhat.com/show_bug.cgi?id=598886

---
 test/t-activate-partial.sh |    2 ++
 tools/toollib.c            |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
test/t-activate-partial.sh +2 -0
index dd978f5..f0a95c5 100644
@@ -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
tools/toollib.c +6 -0
index 4022a32..e6791e2 100644
@@ -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;
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 Require partial option in lvchange --refresh for partials LVs.

Quoted 2 lines · Milan Broz

We must not refresh LV if some PVs are missing and partial activation was not requested.

Ack.

lvchange --refresh and lvchange -ay should behave the same as each other.

Alasdair