Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...

PATCH [email protected] 1 participant 1 message Jul 7, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2010-07-07 02:53:17

Modified files:
. : WHATS_NEW
lib/metadata : metadata.c metadata.h

Log message:
Adjust auto-metadata repair and caching logic to try to cope with empty mdas.

- If a PV contained empty mdas, the auto-recovery code was not kicking in.
- The 'inconsistent' state was getting lost when metadata was cached so recovery didn't kick in. But leave the behaviour alone when using precommitted metadata because of a warning in a confusing FIXME.

In my testing, pvs and vgs didn't repair inconsistent metadata like they used to do. (How many other tools fail similarly now?)

And there should be no need to cache inconsistent metadata because it is supposed to get repaired under the protection of a write lock immediately it is discovered.

This code is in need of a redesign based on first principles. I still see bugs in this code and this commit is risky.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1656&r2=1.1657
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.383&r2=1.384
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.214&r2=1.215

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.71 -
 ===============================
+  Adjust auto-metadata repair and caching logic to try to cope with empty mdas.
 
 Version 2.02.70 - 6th July 2010
 ===============================
lib/metadata/metadata.c +44 -8

91 lines not on this page · raw message

lib/metadata/metadata.h +1 -0
@@ -76,6 +76,7 @@
 //#define CONVERTING		0x00400000U	/* LV */
 
 //#define MISSING_PV		0x00800000U	/* PV */
+#define INCONSISTENT_VG		0x00800000U	/* VG - internal use only */
 //#define PARTIAL_LV		0x01000000U	/* LV - derived flag, not
 //						   written out in metadata*/