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

[lvm-devel] [PATCH] (1/3) partial volume group metadata handling (take 2)



Hi,

further cleanups amassed to the patchset:
- PARTIAL_VG is now never set on live metadata
- use vg_missing_pv_count instead of PARTIAL_VG check to see if PVs are missing
- COW LVs (in snapshots) are marked PARTIAL_LV when origin is missing, instead
  of the virtual (snapshotN) LV
- MISSING_PV uses the new compatible flags mechanism

                       
Fri Jul 11 15:15:50 CEST 2008  me mornfall net
  tagged hotspare: partial metadata 2
Fri Jul 11 15:14:32 CEST 2008  me mornfall net
  * Fix typo.
Fri Jul 11 14:44:11 CEST 2008  me mornfall net
  tagged hotspare: base 1
Fri Jul 11 14:44:38 CEST 2008  me mornfall net
  tagged hotspare: partial metadata 1
Fri Jul 11 14:29:20 CEST 2008  me mornfall net
  * Restructure the _lv_each_dependency code a little.
Fri Jul 11 14:17:33 CEST 2008  me mornfall net
  * Fix the dependency structure of snapshots, so that the COW LV is PARTIAL, not the (virtual) snapshot one.
Fri Jul 11 14:16:07 CEST 2008  me mornfall net
  * Fix POSTORDER_FLAG handling to avoid infinite loops...
Thu Jul 10 14:33:52 CEST 2008  me mornfall net
  * Indicate 'p' flag in vgs output when VG has missing PVs.
Thu Jul 10 14:32:57 CEST 2008  me mornfall net
  * No need to check for PARTIAL_VG in check_current_backup.
Thu Jul 10 14:30:26 CEST 2008  me mornfall net
  * Fix active_pvs computation in display.c.
Thu Jul 10 14:30:14 CEST 2008  me mornfall net
  * Remove unused variables (gcc warning).
Thu Jul 10 14:29:59 CEST 2008  me mornfall net
  * Add missing successful returns (caught by gcc).
Thu Jul 10 14:27:19 CEST 2008  me mornfall net
  * Export vg_missing_pv_count.
Thu Jul 10 14:23:58 CEST 2008  me mornfall net
  * Update the partial VG check in vg_remove_single to use _vg_missing_pv_count.
Thu Jul 10 14:23:38 CEST 2008  me mornfall net
  * Update comment to reflect PARTIAL_VG disappearance.
Thu Jul 10 14:23:21 CEST 2008  me mornfall net
  * Remove unreachable code (PARTIAL_VG is never set).
Thu Jul 10 14:18:31 CEST 2008  me mornfall net
  * PARTIAL_VG is never set,  mark partial LVs when there are missing PVs.
Thu Jul 10 14:16:06 CEST 2008  me mornfall net
  * Check for PARTIAL_VG and missing PVs separately in vg_write.
Thu Jul 10 14:13:22 CEST 2008  me mornfall net
  * Never set PARTIAL_VG when importing metadata.
Thu Jul 10 14:09:48 CEST 2008  me mornfall net
  * Do not set PARTIAL_VG for VGs that have MISSING_PV in them.
Thu Jul 10 14:02:14 CEST 2008  me mornfall net
  * Resolve conflict in flags.c.
Tue Jul  8 13:46:12 CEST 2008  me mornfall net
  * Add a missed period.
Tue Jul  8 13:41:24 CEST 2008  me mornfall net
  * Add an exception for reading PARTIAL_VG flag to flags.c.
Mon Jul  7 15:14:21 CEST 2008  me mornfall net
  * Clarify the MISSING_PV, PARTIAL_LV and POSTORDER_FLAG #defines, sync metadata.h with metadata-exported.h.
Mon Jul  7 15:06:45 CEST 2008  me mornfall net
  * Rename various _lv_mark_partial functions to _lv_mark_if_partial*.
Mon Jul  7 15:05:57 CEST 2008  me mornfall net
  * Rename _vg_mark_partial to _vg_mark_if_partial.
Mon Jul  7 15:05:39 CEST 2008  me mornfall net
  * Rename vg_consolidate_partial to _vg_mark_partial_lvs.
Mon Jul  7 15:05:07 CEST 2008  me mornfall net
  * <agk> DFS sells furniture.
Mon Jul  7 15:02:29 CEST 2008  me mornfall net
  * Naming: fun -> fn, d -> data.
Thu Jul  3 18:40:53 CEST 2008  me mornfall net
  * Resolve conflict in metadata.c.
Sun May  4 23:52:54 CEST 2008  me mornfall net
  * Add a comment to _lv_postorder.
Sun May  4 23:52:31 CEST 2008  me mornfall net
  * Rename all mark_missing bits to mark_partial.
Thu Apr 24 22:13:25 CEST 2008  me mornfall net
  * Even better (more resilient) approach to the activation issue.
Thu Apr 24 21:25:38 CEST 2008  me mornfall net
  * A correct fix for the lvconvert --repair vs activation issue.
Thu Apr 24 19:24:56 CEST 2008  me mornfall net
  * Try to fix the lvconvert --repair vs. activation issue.
Sun Apr 20 10:01:09 CEST 2008  me mornfall net
  * Generalize _lv_mark_missing to _lv_postorder with callback.
Sun Mar 23 19:53:26 CET 2008  me mornfall net
  * Update comment for _lv_mark_missing.
Sun Mar 23 19:53:12 CET 2008  me mornfall net
  * Improve error message when partial metadata cannot be written.
Thu Mar 13 17:12:41 CET 2008  me mornfall net
  * The log_lv, origin and cow links are in segments, not in LVs.
Thu Mar 13 17:11:44 CET 2008  me mornfall net
  * Actually mark VG with MISSING_PV in it as PARTIAL_VG.
Thu Mar 13 17:08:00 CET 2008  me mornfall net
  * Don't export PARTIAL_VG, we recompute it every time. Enough to persist MISSING_PV.
Thu Mar 13 17:07:21 CET 2008  me mornfall net
  * Don't forget to mark COMPLETE_LV as non-exported flag.
Thu Mar 13 15:16:34 CET 2008  me mornfall net
  * Simplify and optimize _lv_mark_missing.
Fri Feb 15 10:07:46 CET 2008  me mornfall net
  * Clean up commented out code.
Fri Feb 15 09:49:02 CET 2008  me mornfall net
  * Fix _lv_mark_missing in metadata.c.
Fri Feb 15 09:47:54 CET 2008  me mornfall net
  * Add PARTIAL_LV to flags.c, as NULL (ie. not stored in metadata).
Thu Feb 14 17:37:06 CET 2008  me mornfall net
  * Make the PARTIAL_LV marking transitive.
Thu Feb 14 16:21:19 CET 2008  me mornfall net
  * Mark partial LVs with PARTIAL_LV status flag.
Wed Jan 23 16:56:44 CET 2008  me mornfall net
  * Stub out first pieces of consistent partial VG support.
diff -rN -p -u old-lib-partial_metadata/lib/display/display.c new-lib-partial_metadata/lib/display/display.c
--- old-lib-partial_metadata/lib/display/display.c	2008-07-11 15:19:46.604007207 +0200
+++ new-lib-partial_metadata/lib/display/display.c	2008-07-11 15:19:46.716008201 +0200
@@ -578,10 +578,7 @@ void vgdisplay_full(const struct volume_
 	struct lv_list *lvl;
 	char uuid[64] __attribute((aligned(8)));
 
-	if (vg->status & PARTIAL_VG)
-		active_pvs = list_size(&vg->pvs);
-	else
-		active_pvs = vg->pv_count;
+	active_pvs = vg->pv_count - vg_missing_pv_count(vg);
 
 	log_print("--- Volume group ---");
 	log_print("VG Name               %s", vg->name);
@@ -664,10 +661,7 @@ void vgdisplay_colons(const struct volum
 	const char *access;
 	char uuid[64] __attribute((aligned(8)));
 
-	if (vg->status & PARTIAL_VG)
-		active_pvs = list_size(&vg->pvs);
-	else
-		active_pvs = vg->pv_count;
+	active_pvs = vg->pv_count - vg_missing_pv_count(vg);
 
 	list_iterate_items(lvl, &vg->lvs)
 		if (lv_is_visible(lvl->lv) && !(lvl->lv->status & SNAPSHOT))
diff -rN -p -u old-lib-partial_metadata/lib/format_text/archiver.c new-lib-partial_metadata/lib/format_text/archiver.c
--- old-lib-partial_metadata/lib/format_text/archiver.c	2008-07-11 15:19:46.604007207 +0200
+++ new-lib-partial_metadata/lib/format_text/archiver.c	2008-07-11 15:19:46.704006690 +0200
@@ -393,7 +393,7 @@ void check_current_backup(struct volume_
 	char path[PATH_MAX];
 	struct volume_group *vg_backup;
 
-	if ((vg->status & PARTIAL_VG) || (vg->status & EXPORTED_VG))
+	if (vg->status & EXPORTED_VG)
 		return;
 
 	if (dm_snprintf(path, sizeof(path), "%s/%s",
diff -rN -p -u old-lib-partial_metadata/lib/format_text/flags.c new-lib-partial_metadata/lib/format_text/flags.c
--- old-lib-partial_metadata/lib/format_text/flags.c	2008-07-11 15:19:46.644008984 +0200
+++ new-lib-partial_metadata/lib/format_text/flags.c	2008-07-11 15:19:46.708009871 +0200
@@ -31,12 +31,12 @@ struct flag {
 static struct flag _vg_flags[] = {
 	{EXPORTED_VG, "EXPORTED", STATUS_FLAG},
 	{RESIZEABLE_VG, "RESIZEABLE", STATUS_FLAG},
-	{PARTIAL_VG, "PARTIAL", STATUS_FLAG},
 	{PVMOVE, "PVMOVE", STATUS_FLAG},
 	{LVM_READ, "READ", STATUS_FLAG},
 	{LVM_WRITE, "WRITE", STATUS_FLAG},
 	{CLUSTERED, "CLUSTERED", STATUS_FLAG},
 	{SHARED, "SHARED", STATUS_FLAG},
+	{PARTIAL_VG, NULL, 0},
 	{PRECOMMITTED, NULL, 0},
 	{0, NULL, 0}
 };
@@ -44,6 +44,7 @@ static struct flag _vg_flags[] = {
 static struct flag _pv_flags[] = {
 	{ALLOCATABLE_PV, "ALLOCATABLE", STATUS_FLAG},
 	{EXPORTED_VG, "EXPORTED", STATUS_FLAG},
+	{MISSING_PV, "MISSING", COMPATIBLE_FLAG},
 	{0, NULL, 0}
 };
 
@@ -62,6 +63,8 @@ static struct flag _lv_flags[] = {
 	{SNAPSHOT, NULL, 0},
 	{ACTIVATE_EXCL, NULL, 0},
 	{CONVERTING, NULL, 0},
+	{PARTIAL_LV, NULL, 0},
+	{POSTORDER_FLAG, NULL, 0},
 	{0, NULL, 0}
 };
 
@@ -155,7 +158,16 @@ int read_flags(uint32_t *status, int typ
 				break;
 			}
 
-		if (!flags[f].description && (type & STATUS_FLAG)) {
+		if (type == VG_FLAGS && !strcmp(cv->v.str, "PARTIAL")) {
+			/*
+			 * Exception: We no longer write this flag out, but it
+			 * might be encountered in old backup files, so restore
+			 * it in that case. It is never part of live metadata
+			 * though, so only vgcfgrestore needs to be concerned
+			 * by this case.
+			 */
+			s |= PARTIAL_VG;
+		} else if (!flags[f].description && (type & STATUS_FLAG)) {
 			log_err("Unknown status flag '%s'.", cv->v.str);
 			return 0;
 		}
diff -rN -p -u old-lib-partial_metadata/lib/format_text/import_vsn1.c new-lib-partial_metadata/lib/format_text/import_vsn1.c
--- old-lib-partial_metadata/lib/format_text/import_vsn1.c	2008-07-11 15:19:46.644008984 +0200
+++ new-lib-partial_metadata/lib/format_text/import_vsn1.c	2008-07-11 15:19:46.704006690 +0200
@@ -194,11 +194,6 @@ static int _read_pv(struct format_instan
 		else
 			log_error("Couldn't find device with uuid '%s'.",
 				  buffer);
-
-		if (partial_mode())
-			vg->status |= PARTIAL_VG;
-		else
-			return 0;
 	}
 
 	if (!(pv->vg_name = dm_pool_strdup(mem, vg->name)))
@@ -211,6 +206,9 @@ static int _read_pv(struct format_instan
 		return 0;
 	}
 
+	if (!pv->dev)
+		pv->status |= MISSING_PV;
+
 	/* Late addition */
 	_read_int64(pvn, "dev_size", &pv->size);
 
@@ -799,11 +797,6 @@ static struct volume_group *_read_vg(str
 
 	dm_hash_destroy(pv_hash);
 
-	if (vg->status & PARTIAL_VG) {
-		vg->status &= ~LVM_WRITE;
-		vg->status |= LVM_READ;
-	}
-
 	/*
 	 * Finished.
 	 */
diff -rN -p -u old-lib-partial_metadata/lib/metadata/metadata.c new-lib-partial_metadata/lib/metadata/metadata.c
--- old-lib-partial_metadata/lib/metadata/metadata.c	2008-07-11 15:19:46.644008984 +0200
+++ new-lib-partial_metadata/lib/metadata/metadata.c	2008-07-11 15:19:46.716008201 +0200
@@ -314,9 +314,9 @@ int vg_remove_single(struct cmd_context 
 	struct pv_list *pvl;
 	int ret = 1;
 
-	if (!vg || !consistent || (vg_status(vg) & PARTIAL_VG)) {
-		log_error("Volume group \"%s\" not found or inconsistent.",
-			  vg_name);
+	if (!vg || !consistent || vg_missing_pv_count(vg)) {
+		log_error("Volume group \"%s\" not found, is inconsistent "
+			  "or has PVs missing.", vg_name);
 		log_error("Consider vgreduce --removemissing if metadata "
 			  "is inconsistent.");
 		return 0;
@@ -1171,6 +1171,161 @@ int vgs_are_compatible(struct cmd_contex
 	return 1;
 }
 
+struct _lv_postorder_baton {
+	int (*fn)(struct logical_volume *lv, void *data);
+	void *data;
+};
+
+static int _lv_postorder_visit(struct logical_volume *,
+			       int (*fn)(struct logical_volume *lv, void *data),
+			       void *data);
+
+static int _lv_postorder_level(struct logical_volume *lv, void *data)
+{
+	struct _lv_postorder_baton *baton = data;
+	lv->status |= POSTORDER_FLAG;
+	return _lv_postorder_visit(lv, baton->fn, baton->data);
+};
+
+static int _lv_each_dependency(struct logical_volume *lv,
+			       int (*fn)(struct logical_volume *lv, void *data),
+			       void *data)
+{
+	int i, s;
+	struct lv_segment *lvseg;
+
+	struct logical_volume *deps[] = {
+		lv->snapshot ? lv->snapshot->origin : 0,
+		lv->snapshot ? lv->snapshot->cow : 0 };
+	for (i = 0; i < sizeof(deps) / sizeof(*deps); ++i) {
+		if (deps[i]) {
+			if (!fn(deps[i], data))
+				return 0;
+		}
+	}
+
+	list_iterate_items(lvseg, &lv->segments) {
+		if (lvseg->log_lv) {
+			if (!fn(deps[i], data))
+				return 0;
+		}
+		for (s = 0; s < lvseg->area_count; ++s) {
+			if (seg_type(lvseg, s) == AREA_LV) {
+				if (!fn(seg_lv(lvseg,s), data))
+					return 0;
+			}
+		}
+	}
+	return 1;
+}
+
+static int _lv_postorder_cleanup(struct logical_volume *lv, void *data)
+{
+	if (!(lv->status & POSTORDER_FLAG))
+		return 1;
+	lv->status &= ~POSTORDER_FLAG;
+
+	_lv_each_dependency(lv, _lv_postorder_cleanup, data);
+	return 1;
+}
+
+static int _lv_postorder_visit(struct logical_volume *lv,
+			       int (*fn)(struct logical_volume *lv, void *data),
+			       void *data)
+{
+	struct _lv_postorder_baton baton;
+	int r;
+
+	if (lv->status & POSTORDER_FLAG)
+		return 1;
+
+	baton.fn = fn;
+	baton.data = data;
+	r = _lv_each_dependency(lv, _lv_postorder_level, &baton);
+	if (r) {
+		r = fn(lv, data);
+		log_verbose("visited %s", lv->name);
+	}
+	return r;
+}
+
+/*
+ * This will walk the LV dependency graph in depth-first order and in the
+ * postorder, call a callback function "fn". The void *data is passed along all
+ * the calls. The callback may return zero to indicate an error and terminate
+ * the depth-first walk. The error is propagated to return value of
+ * _lv_postorder.
+ */
+static int _lv_postorder(struct logical_volume *lv,
+			       int (*fn)(struct logical_volume *lv, void *data),
+			       void *data)
+{
+	int r;
+	r = _lv_postorder_visit(lv, fn, data);
+	_lv_postorder_cleanup(lv, 0);
+	return r;
+}
+
+struct _lv_mark_if_partial_baton {
+	int partial;
+};
+
+static int _lv_mark_if_partial_collect(struct logical_volume *lv, void *data)
+{
+	struct _lv_mark_if_partial_baton *baton = data;
+	if (lv->status & PARTIAL_LV)
+		baton->partial = 1;
+
+	return 1;
+}
+
+static int _lv_mark_if_partial_single(struct logical_volume *lv, void *data)
+{
+	int s;
+	struct _lv_mark_if_partial_baton baton;
+	struct lv_segment *lvseg;
+
+	baton.partial = 0;
+	_lv_each_dependency(lv, _lv_mark_if_partial_collect, &baton);
+
+	if (baton.partial)
+		lv->status |= PARTIAL_LV;
+
+	list_iterate_items(lvseg, &lv->segments) {
+		for (s = 0; s < lvseg->area_count; ++s) {
+			if (seg_type(lvseg, s) == AREA_PV) {
+				if (seg_pv(lvseg, s)->status & MISSING_PV)
+					lv->status |= PARTIAL_LV;
+			}
+		}
+	}
+
+	return 1;
+}
+
+static int _lv_mark_if_partial(struct logical_volume *lv)
+{
+	return _lv_postorder(lv, _lv_mark_if_partial_single, NULL);
+}
+
+/*
+ * Mark LVs with missing PVs using PARTIAL_LV status flag. The flag is
+ * propagated transitively, so LVs referencing other LVs are marked
+ * partial as well, if any of their referenced LVs are marked partial.
+ */
+static int _vg_mark_partial_lvs(struct volume_group *vg)
+{
+	struct logical_volume *lv;
+	struct lv_list *lvl;
+
+	list_iterate_items(lvl, &vg->lvs) {
+		lv = lvl->lv;
+		if (!_lv_mark_if_partial(lv))
+			return_0;
+	}
+	return 1;
+}
+
 int vg_validate(struct volume_group *vg)
 {
 	struct pv_list *pvl, *pvl2;
@@ -1268,8 +1423,13 @@ int vg_write(struct volume_group *vg)
 		return_0;
 
 	if (vg->status & PARTIAL_VG) {
-		log_error("Cannot change metadata for partial volume group %s",
-			  vg->name);
+		log_error("Cannot update partial volume group %s.", vg->name);
+		return 0;
+	}
+
+	if (vg_missing_pv_count(vg)) {
+		log_error("Cannot update volume group %s while physical "
+			  "volumes are missing.", vg->name);
 		return 0;
 	}
 
@@ -1468,9 +1628,20 @@ static int _update_pv_list(struct list *
 	return 1;
 }
 
+int vg_missing_pv_count(const vg_t *vg)
+{
+	int ret = 0;
+	struct pv_list *pvl;
+	list_iterate_items(pvl, &vg->pvs) {
+		if (pvl->pv->status & MISSING_PV)
+			++ ret;
+	}
+	return ret;
+}
+
 /* Caller sets consistent to 1 if it's safe for vg_read to correct
  * inconsistent metadata on disk (i.e. the VG write lock is held).
- * This guarantees only consistent metadata is returned unless PARTIAL_VG.
+ * This guarantees only consistent metadata is returned.
  * If consistent is 0, caller must check whether consistent == 1 on return
  * and take appropriate action if it isn't (e.g. abort; get write lock
  * and call vg_read again).
@@ -1604,7 +1775,8 @@ static struct volume_group *_vg_read(str
 			}
 		}
 
-		if (list_size(&correct_vg->pvs) != list_size(pvids)) {
+		if (list_size(&correct_vg->pvs) != list_size(pvids)
+		    + vg_missing_pv_count(correct_vg)) {
 			log_debug("Cached VG %s had incorrect PV list",
 				  vgname);
 
@@ -1613,6 +1785,8 @@ static struct volume_group *_vg_read(str
 			else
 				correct_vg = NULL;
 		} else list_iterate_items(pvl, &correct_vg->pvs) {
+			if (pvl->pv->status & MISSING_PV)
+				continue;
 			if (!str_list_match_item(pvids, pvl->pv->dev->pvid)) {
 				log_debug("Cached VG %s had incorrect PV list",
 					  vgname);
@@ -1695,15 +1869,6 @@ static struct volume_group *_vg_read(str
 		if (!*consistent)
 			return correct_vg;
 
-		/* Don't touch partial volume group metadata */
-		/* Should be fixed manually with vgcfgbackup/restore etc. */
-		if ((correct_vg->status & PARTIAL_VG)) {
-			log_error("Inconsistent metadata copies found for "
-				  "partial volume group %s", vgname);
-			*consistent = 0;
-			return correct_vg;
-		}
-
 		/* Don't touch if vgids didn't match */
 		if (inconsistent_vgid) {
 			log_error("Inconsistent metadata UUIDs found for "
@@ -1742,6 +1907,11 @@ static struct volume_group *_vg_read(str
 		}
 	}
 
+	if (vg_missing_pv_count(correct_vg)) {
+		if (*consistent)
+			_vg_mark_partial_lvs(correct_vg);
+	}
+
 	if ((correct_vg->status & PVMOVE) && !pvmove_mode()) {
 		log_error("WARNING: Interrupted pvmove detected in "
 			  "volume group %s", correct_vg->name);
diff -rN -p -u old-lib-partial_metadata/lib/metadata/metadata-exported.h new-lib-partial_metadata/lib/metadata/metadata-exported.h
--- old-lib-partial_metadata/lib/metadata/metadata-exported.h	2008-07-11 15:19:46.644008984 +0200
+++ new-lib-partial_metadata/lib/metadata/metadata-exported.h	2008-07-11 15:19:46.712008861 +0200
@@ -71,6 +71,13 @@ struct pv_segment;
 //#define PRECOMMITTED		0x00200000U	/* VG - internal use only */
 #define CONVERTING		0x00400000U	/* LV */
 
+#define MISSING_PV              0x00800000U	/* PV */
+#define PARTIAL_LV              0x01000000U	/* LV - derived flag, not
+						   written out in metadata*/
+
+//#define POSTORDER_FLAG	0x02000000U /* Not a real flag, reserved for
+//					       temporary use inside vg_read. */
+
 #define LVM_READ              	0x00000100U	/* LV VG */
 #define LVM_WRITE             	0x00000200U	/* LV VG */
 #define CLUSTERED         	0x00000400U	/* VG */
@@ -559,6 +566,7 @@ uint64_t pv_pe_start(const pv_t *pv);
 uint32_t pv_pe_count(const pv_t *pv);
 uint32_t pv_pe_alloc_count(const pv_t *pv);
 
+int vg_missing_pv_count(const vg_t *vg);
 uint32_t vg_status(const vg_t *vg);
 #define vg_is_clustered(vg) (vg_status((vg)) & CLUSTERED)
 
diff -rN -p -u old-lib-partial_metadata/lib/metadata/metadata.h new-lib-partial_metadata/lib/metadata/metadata.h
--- old-lib-partial_metadata/lib/metadata/metadata.h	2008-07-11 15:19:46.612010146 +0200
+++ new-lib-partial_metadata/lib/metadata/metadata.h	2008-07-11 15:19:46.716008201 +0200
@@ -61,6 +61,14 @@
 //#define MIRROR_NOTSYNCED	0x00080000U	/* LV */
 #define ACTIVATE_EXCL		0x00100000U	/* LV - internal use only */
 #define PRECOMMITTED		0x00200000U	/* VG - internal use only */
+//#define CONVERTING		0x00400000U	/* LV */
+
+//#define MISSING_PV		0x00800000U	/* PV */
+//#define PARTIAL_LV		0x01000000U	/* LV - derived flag, not
+//						   written out in metadata*/
+
+#define POSTORDER_FLAG		0x02000000U /* Not a real flag, reserved for
+					       temporary use inside vg_read. */
 
 //#define LVM_READ              	0x00000100U	/* LV VG */
 //#define LVM_WRITE             	0x00000200U	/* LV VG */
diff -rN -p -u old-lib-partial_metadata/lib/report/report.c new-lib-partial_metadata/lib/report/report.c
--- old-lib-partial_metadata/lib/report/report.c	2008-07-11 15:19:46.604007207 +0200
+++ new-lib-partial_metadata/lib/report/report.c	2008-07-11 15:19:46.700007630 +0200
@@ -439,7 +439,7 @@ static int _vgstatus_disp(struct dm_repo
 	else
 		repstr[2] = '-';
 
-	if (vg->status & PARTIAL_VG)
+	if (vg_missing_pv_count(vg))
 		repstr[3] = 'p';
 	else
 		repstr[3] = '-';

Yours,
    Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation

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