Skip to contentSkip to conversation

LVM: add logic to allow mirrored log

PATCH In review Jonathan Brassow 2 participants 3 messages Feb 26, 2010 – Mar 1, 2010 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LVM: add logic to allow mirrored log

Patch name: lvm-add-logic-to-allow-mirrored-log.patch

Insert the couple of lines that adds the logic necessary to create the mirrored log.

lib/metadata/mirror.c +7 -1
Index: LVM2/lib/metadata/mirror.c
===================================================================
@@ -1591,7 +1591,7 @@ static struct logical_volume *_set_up_mi
 						 struct alloc_handle *ah,
 						 struct logical_volume *lv,
 						 uint32_t log_count,
-						 uint32_t region_size __attribute((unused)),
+						 uint32_t region_size,
 						 alloc_policy_t alloc,
 						 int in_sync)
 {
@@ -1635,6 +1635,12 @@ static struct logical_volume *_set_up_mi
 		return NULL;
 	}
 
+	if ((log_count > 1) &&
+	    !_form_mirror(cmd, ah, log_lv, log_count-1, region_size)) {
+		log_error("Failed to form mirrored log.");
+		return NULL;
+	}
+
 	if (!_init_mirror_log(cmd, log_lv, in_sync, &lv->tags, 1)) {
 		log_error("Failed to initialise mirror log.");
 		return NULL;
tools/lvconvert.c +63 -16

124 lines not on this page · raw message

#2 lore raw

I've added your changes into my patches.

Quoted 5 lines · Takahiro Yasui

Hello Jon,

I haven't got your comments for the following emails.

https://www.redhat.com/archives/lvm-devel/2010-February/msg00207.html

I changed this one slightly. I'm checking if the log_lv is mirrored before calling _failed_mirrors_count - that way, we aren't relying on an error to tell us if the log was mirrored or not.

Quoted 1 line

https://www.redhat.com/archives/lvm-devel/2010-February/msg00213.html

Pulled in as suggested.

Quoted 6 lines

Could please you check them?

I tested your new patch set, but the above two issues haven't been fixed.

Please tell me if I have misunderstandings.

The allocation changes that were made are causing issues with the '--alloc anywhere' condition in my tests. I'm working to address this now.

brassow