[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] broken vg after vgconvert -M1



Hello.

I tried to convert my VG to LVM1 format.
I use lvm2-2.02.33, and vgconvert segfaults.
Not knowing that the problem is alreay
fixed in CVS, I made the attached patch.
The conversion then succeeded, according
to the vgconvert message, but now I get
---
 Invalid LV in extent map (PV /dev/sdb3, PE 0, LV 0, LE 0)
 Couldn't fill logical volume maps.
 Volume group "fedora_vg" not found
---
from any lvm tool.
Oddly enough, vgck says the same.
I am a bit confused about that. Are there
any ways to recover the vg now? And what
could lead to the corruption? Could my patch
be guilty, or are there other bugs in vgconvert?

I also wonder how the lvnum_from_lvid()
supposed to ever work at all. It iterates
32 times in a loop, multiplying the int32
variable by 64 every iter. But only 5
iterations are safe, the rest may (and does)
overflow.

--- lib/uuid/uuid.c.old	2008-01-30 17:00:01.000000000 +0300
+++ lib/uuid/uuid.c	2008-12-05 13:39:53.000000000 +0300
@@ -58,9 +58,10 @@
 	return 1;
 }
 
-int lvnum_from_lvid(union lvid *lvid)
+uint32_t lvnum_from_lvid(union lvid *lvid)
 {
-	int i, lv_num = 0;
+	uint32_t lv_num = 0;
+	int i;
 	char *c;
 
 	for (i = 0; i < ID_LEN; i++) {
--- lib/uuid/uuid.h.old	2007-08-21 00:55:27.000000000 +0400
+++ lib/uuid/uuid.h	2008-12-05 13:40:17.000000000 +0300
@@ -33,7 +33,7 @@
 };
 
 int lvid_from_lvnum(union lvid *lvid, struct id *vgid, uint32_t lv_num);
-int lvnum_from_lvid(union lvid *lvid);
+uint32_t lvnum_from_lvid(union lvid *lvid);
 
 void uuid_from_num(char *uuid, uint32_t num);
 
--- lib/metadata/lv_manip.c.old	2008-01-30 17:17:29.000000000 +0300
+++ lib/metadata/lv_manip.c	2008-12-05 13:43:00.000000000 +0300
@@ -141,7 +141,7 @@
 	int lvnum_used[MAX_RESTRICTED_LVS + 1];
 	uint32_t i = 0;
 	struct lv_list *lvl;
-	int lvnum;
+	uint32_t lvnum;
 
 	memset(&lvnum_used, 0, sizeof(lvnum_used));
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]