public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2010-09-23 12:02 prajnoha
  0 siblings, 0 replies; 16+ messages in thread
From: prajnoha @ 2010-09-23 12:02 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2010-09-23 12:02:35

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c 
	lib/misc       : lvm-string.c lvm-string.h 
	tools          : pvchange.c pvck.c pvcreate.c pvmove.c 
	                 pvremove.c toollib.c vgsplit.c 

Log message:
	Add escape sequence for ':' and '@' found in device names used as PVs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1734&r2=1.1735
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.396&r2=1.397
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.h.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvck.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvcreate.c.diff?cvsroot=lvm2&r1=1.91&r2=1.92
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvremove.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.208&r2=1.209
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.101&r2=1.102

--- LVM2/WHATS_NEW	2010/09/22 22:31:45	1.1734
+++ LVM2/WHATS_NEW	2010/09/23 12:02:33	1.1735
@@ -1,5 +1,6 @@
 Version 2.02.74 - 
 =====================================
+  Add escape sequence for ':' and '@' found in device names used as PVs.
   Replace alloca with dm_malloc in _aligned_io.
   Fix partial mode operations for lvm1 metadata format.
   Track recursive filter iteration to avoid refreshing while in use. (2.02.56)
--- LVM2/lib/metadata/metadata.c	2010/08/20 20:59:07	1.396
+++ LVM2/lib/metadata/metadata.c	2010/09/23 12:02:34	1.397
@@ -677,6 +677,7 @@
 
 	/* attach each pv */
 	for (i = 0; i < pv_count; i++) {
+		unescape_colons_and_at_signs(pv_names[i], NULL, NULL);
 		if (!vg_extend_single_pv(vg, pv_names[i], pp))
 			goto bad;
 	}
--- LVM2/lib/misc/lvm-string.c	2010/09/20 14:25:27	1.21
+++ LVM2/lib/misc/lvm-string.c	2010/09/23 12:02:34	1.22
@@ -109,19 +109,31 @@
 }
 
 /*
- * Unquote orig_char in string.
- * Also unquote quote_char.
- */
-static void _unquote_characters(char *src, const int orig_char,
-				const int quote_char)
+ * Unquote each character given in orig_char array and unquote quote_char
+ * as well. The array ends up with '\0' character. Also save the first
+ * occurence of each character from orig_char that was found unquoted in
+ * arr_substr_first_unquoted array. This way we can process several
+ * characters in one go.
+ */
+static void _unquote_characters(char *src, const int orig_chars[],
+				const int quote_char,
+				char *arr_substr_first_unquoted[])
 {
 	char *out = src;
+	int c;
+	int i;
 
 	while (*src) {
-		if (*src == quote_char &&
-		    (*(src + 1) == orig_char || *(src + 1) == quote_char))
-			src++;
-
+		for (i = 0; (c = orig_chars[i]); i++) {
+			if (*src == quote_char &&
+			    (*(src + 1) == c || *(src + 1) == quote_char)) {
+				src++;
+				break;
+			}
+			else if (arr_substr_first_unquoted && (*src == c) &&
+				 !arr_substr_first_unquoted[i])
+				arr_substr_first_unquoted[i] = out;
+		}
 		*out++ = *src++;
 	}
 
@@ -217,7 +229,31 @@
  */
 void unescape_double_quotes(char *src)
 {
-	_unquote_characters(src, '\"', '\\');
+	const int orig_chars[] = {'\"', '\0'};
+
+	_unquote_characters(src, orig_chars, '\\', NULL);
+}
+
+/*
+ * Unescape colons and "at" signs in situ and save the substrings
+ * starting at the position of the first unescaped colon and the
+ * first unescaped "at" sign. This is normally used to unescape
+ * device names used as PVs.
+ */
+void unescape_colons_and_at_signs(char *src,
+				  char **substr_first_unquoted_colon,
+				  char **substr_first_unquoted_at_sign)
+{
+	const int orig_chars[] = {':', '@', '\0'};
+	char *arr_substr_first_unquoted[] = {NULL, NULL, NULL};
+
+	_unquote_characters(src, orig_chars, '\\', arr_substr_first_unquoted);
+
+	if (substr_first_unquoted_colon)
+		*substr_first_unquoted_colon = arr_substr_first_unquoted[0];
+
+	if (substr_first_unquoted_at_sign)
+		*substr_first_unquoted_at_sign = arr_substr_first_unquoted[1];
 }
 
 /*
--- LVM2/lib/misc/lvm-string.h	2010/04/23 14:16:33	1.20
+++ LVM2/lib/misc/lvm-string.h	2010/09/23 12:02:34	1.21
@@ -60,4 +60,13 @@
  */
 void unescape_double_quotes(char *src);
 
+/*
+ * Unescape colons and at signs in situ and save the substring starting
+ * at the position of the first unescaped colon and the first unescaped
+ * "at" sign.
+ */
+void unescape_colons_and_at_signs(char *src,
+				  char **substr_first_unquoted_colon,
+				  char **substr_first_unquoted_at_sign);
+
 #endif
--- LVM2/tools/pvchange.c	2010/07/09 15:34:48	1.83
+++ LVM2/tools/pvchange.c	2010/09/23 12:02:34	1.84
@@ -195,7 +195,8 @@
 	int total = 0;
 
 	struct volume_group *vg;
-	const char *pv_name, *vg_name;
+	const char *vg_name;
+	char *pv_name;
 
 	struct pv_list *pvl;
 	struct dm_list *vgnames;
@@ -223,6 +224,7 @@
 		log_verbose("Using physical volume(s) on command line");
 		for (; opt < argc; opt++) {
 			pv_name = argv[opt];
+			unescape_colons_and_at_signs(pv_name, NULL, NULL);
 			vg_name = find_vgname_from_pvname(cmd, pv_name);
 			if (!vg_name) {
 				log_error("Failed to read physical volume %s",
--- LVM2/tools/pvck.c	2007/08/22 14:38:18	1.4
+++ LVM2/tools/pvck.c	2010/09/23 12:02:34	1.5
@@ -31,6 +31,7 @@
 		/* FIXME: warning and/or check if in use? */
 		log_verbose("Scanning %s", argv[i]);
 
+		unescape_colons_and_at_signs(argv[i], NULL, NULL);
 		pv_analyze(cmd, argv[i],
 			   arg_uint64_value(cmd, labelsector_ARG,
 					   UINT64_C(0)));
--- LVM2/tools/pvcreate.c	2010/08/12 04:09:00	1.91
+++ LVM2/tools/pvcreate.c	2010/09/23 12:02:34	1.92
@@ -109,6 +109,8 @@
 			return ECMD_FAILED;
 		}
 
+		unescape_colons_and_at_signs(argv[i], NULL, NULL);
+
 		if (!pvcreate_single(cmd, argv[i], &pp)) {
 			stack;
 			ret = ECMD_FAILED;
--- LVM2/tools/pvmove.c	2010/08/23 11:34:10	1.79
+++ LVM2/tools/pvmove.c	2010/09/23 12:02:34	1.80
@@ -644,17 +644,16 @@
 	}
 
 	if (argc) {
-		pv_name = argv[0];
+		if (!(pv_name = dm_pool_strdup(cmd->mem, argv[0]))) {
+			log_error("Failed to clone PV name");
+			return ECMD_FAILED;
+		}
+
+		unescape_colons_and_at_signs(pv_name, &colon, NULL);
 
 		/* Drop any PE lists from PV name */
-		if ((colon = strchr(pv_name, ':'))) {
-			if (!(pv_name = dm_pool_strndup(cmd->mem, pv_name,
-						     (unsigned) (colon -
-								 pv_name)))) {
-				log_error("Failed to clone PV name");
-				return ECMD_FAILED;
-			}
-		}
+		if (colon)
+			*colon = '\0';
 
 		if (!arg_count(cmd, abort_ARG) &&
 		    (ret = _set_up_pvmove(cmd, pv_name, argc, argv)) !=
--- LVM2/tools/pvremove.c	2010/08/19 23:04:37	1.29
+++ LVM2/tools/pvremove.c	2010/09/23 12:02:34	1.30
@@ -144,6 +144,7 @@
 	}
 
 	for (i = 0; i < argc; i++) {
+		unescape_colons_and_at_signs(argv[i], NULL, NULL);
 		r = pvremove_single(cmd, argv[i], NULL);
 		if (r > ret)
 			ret = r;
--- LVM2/tools/toollib.c	2010/08/19 23:04:37	1.208
+++ LVM2/tools/toollib.c	2010/09/23 12:02:34	1.209
@@ -680,7 +680,7 @@
 	struct dm_list *pvslist, *vgnames;
 	struct dm_list tags;
 	struct str_list *sll;
-	char *tagname;
+	char *at_sign, *tagname;
 	int scanned = 0;
 	struct dm_list mdas;
 
@@ -694,8 +694,9 @@
 	if (argc) {
 		log_verbose("Using physical volume(s) on command line");
 		for (; opt < argc; opt++) {
-			if (*argv[opt] == '@') {
-				tagname = argv[opt] + 1;
+			unescape_colons_and_at_signs(argv[opt], NULL, &at_sign);
+			if (at_sign && (at_sign == argv[opt])) {
+				tagname = at_sign + 1;
 
 				if (!validate_name(tagname)) {
 					log_error("Skipping invalid tag %s",
@@ -1093,8 +1094,8 @@
 	struct dm_list *r;
 	struct pv_list *pvl;
 	struct dm_list tags, arg_pvnames;
-	const char *pvname = NULL;
-	char *colon, *tagname;
+	char *pvname = NULL;
+	char *colon, *at_sign, *tagname;
 	int i;
 
 	/* Build up list of PVs */
@@ -1108,8 +1109,10 @@
 	dm_list_init(&arg_pvnames);
 
 	for (i = 0; i < argc; i++) {
-		if (*argv[i] == '@') {
-			tagname = argv[i] + 1;
+		unescape_colons_and_at_signs(argv[i], &colon, &at_sign);
+
+		if (at_sign && (at_sign == argv[i])) {
+			tagname = at_sign + 1;
 			if (!validate_name(tagname)) {
 				log_error("Skipping invalid tag %s", tagname);
 				continue;
@@ -1128,13 +1131,10 @@
 
 		pvname = argv[i];
 
-		if ((colon = strchr(pvname, ':'))) {
-			if (!(pvname = dm_pool_strndup(mem, pvname,
-						    (unsigned) (colon -
-								pvname)))) {
-				log_error("Failed to clone PV name");
-				return NULL;
-			}
+		if (colon && !(pvname = dm_pool_strndup(mem, pvname,
+					(unsigned) (colon - pvname)))) {
+			log_error("Failed to clone PV name");
+			return NULL;
 		}
 
 		if (!(pvl = find_pv_in_vg(vg, pvname))) {
--- LVM2/tools/vgsplit.c	2010/06/30 20:03:53	1.101
+++ LVM2/tools/vgsplit.c	2010/09/23 12:02:34	1.102
@@ -394,6 +394,7 @@
 
 	/* Move PVs across to new structure */
 	for (opt = 0; opt < argc; opt++) {
+		unescape_colons_and_at_signs(argv[opt], NULL, NULL);
 		if (!move_pv(vg_from, vg_to, argv[opt]))
 			goto_bad;
 	}


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2011-11-04 22:49 zkabelac
  0 siblings, 0 replies; 16+ messages in thread
From: zkabelac @ 2011-11-04 22:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-04 22:49:53

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c vg.c vg.h 
	tools          : lvresize.c 

Log message:
	Avoid lvextend to overflow
	
	Add extra check to extent_count overflow.
	Use internal define MAX_EXTENT_COUNT instead UINT32_MAX.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2177&r2=1.2178
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.471&r2=1.472
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/vg.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/vg.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141

--- LVM2/WHATS_NEW	2011/11/04 01:31:23	1.2177
+++ LVM2/WHATS_NEW	2011/11/04 22:49:53	1.2178
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix extent_count overflow with lvextend.
   Add missing lvrename mirrored log recursion in for_each_sub_lv.
   Improve lv_extend stack reporting.
   Increase virtual segment size instead of creating multiple segment list.
--- LVM2/lib/metadata/metadata.c	2011/10/28 20:12:55	1.471
+++ LVM2/lib/metadata/metadata.c	2011/11/04 22:49:53	1.472
@@ -276,12 +276,12 @@
 	if (!alloc_pv_segment_whole_pv(mem, pv))
 		return_0;
 
-	if ((uint64_t) vg->extent_count + pv->pe_count > UINT32_MAX) {
+	if ((uint64_t) vg->extent_count + pv->pe_count > MAX_EXTENT_COUNT) {
 		log_error("Unable to add %s to %s: new extent count (%"
 			  PRIu64 ") exceeds limit (%" PRIu32 ").",
 			  pv_name, vg->name,
 			  (uint64_t) vg->extent_count + pv->pe_count,
-			  UINT32_MAX);
+			  MAX_EXTENT_COUNT);
 		return 0;
 	}
 
@@ -1000,12 +1000,12 @@
 			  display_size(cmd, size));
 	}
 
-	if (size > (uint64_t) UINT32_MAX * extent_size) {
+	if (size > (uint64_t) MAX_EXTENT_COUNT * extent_size) {
 		log_error("Volume too large (%s) for extent size %s. "
 			  "Upper limit is %s.",
 			  display_size(cmd, size),
 			  display_size(cmd, (uint64_t) extent_size),
-			  display_size(cmd, (uint64_t) UINT32_MAX *
+			  display_size(cmd, (uint64_t) MAX_EXTENT_COUNT *
 				       extent_size));
 		return 0;
 	}
--- LVM2/lib/metadata/vg.c	2011/08/11 17:24:24	1.12
+++ LVM2/lib/metadata/vg.c	2011/11/04 22:49:53	1.13
@@ -261,7 +261,7 @@
 
 	size /= new_size;
 
-	if (size > UINT32_MAX) {
+	if (size > MAX_EXTENT_COUNT) {
 		log_error("New extent count %" PRIu64 " for %s%s exceeds "
 			  "32 bits.", size, desc1, desc2);
 		return 0;
--- LVM2/lib/metadata/vg.h	2011/08/11 17:24:24	1.15
+++ LVM2/lib/metadata/vg.h	2011/11/04 22:49:53	1.16
@@ -37,6 +37,8 @@
 	struct pvcreate_params *pp;
 };
 
+#define MAX_EXTENT_COUNT  (UINT32_MAX)
+
 struct volume_group {
 	struct cmd_context *cmd;
 	struct dm_pool *vgmem;
--- LVM2/tools/lvresize.c	2011/10/28 20:31:01	1.140
+++ LVM2/tools/lvresize.c	2011/11/04 22:49:53	1.141
@@ -459,8 +459,14 @@
 			break;
 	}
 
-	if (lp->sign == SIGN_PLUS)
+	if (lp->sign == SIGN_PLUS) {
+		if (lp->extents >= (MAX_EXTENT_COUNT - lv->le_count)) {
+			log_error("Unable to extend %s by %u extents, exceeds limit (%u).",
+				  lp->lv_name, lv->le_count, MAX_EXTENT_COUNT);
+			return EINVALID_CMD_LINE;
+		}
 		lp->extents += lv->le_count;
+	}
 
 	if (lp->sign == SIGN_MINUS) {
 		if (lp->extents >= lv->le_count) {


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2011-08-10 20:17 zkabelac
  0 siblings, 0 replies; 16+ messages in thread
From: zkabelac @ 2011-08-10 20:17 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-08-10 20:17:33

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

Log message:
	Remove INCONSISTENT_VG flag
	
	As this flag could not have been set by the current code - removing it.
	
	Note: because of the wrong code logic this call:
	
	lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED &
	(inconsistent ? INCONSISTENT_VG : 0));
	
	had always passed '0' - now after flag removal it's passing
	PRECOMMITTED flag in - this present functinal change in this patch.
	
	To match the original functionality - 0 had to be always passed.
	More testing is needed here.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2056&r2=1.2057
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.460&r2=1.461
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.248&r2=1.249

--- LVM2/WHATS_NEW	2011/08/10 16:07:53	1.2056
+++ LVM2/WHATS_NEW	2011/08/10 20:17:33	1.2057
@@ -1,5 +1,6 @@
 Version 2.02.87 - 
 ===============================
+  Remove INCONSISTENT_VG flag from the code.
   Remove lock from cache even if unlock fails.
   Initialise clvmd locks before lvm context to avoid open descriptor leaks.
   Remove obsoleted GULM clvmd cluster locking support.
--- LVM2/lib/metadata/metadata.c	2011/08/04 15:18:11	1.460
+++ LVM2/lib/metadata/metadata.c	2011/08/10 20:17:33	1.461
@@ -2861,12 +2861,8 @@
 	 * the missing PV logic below.
 	 */
 	if ((correct_vg = lvmcache_get_vg(vgid, precommitted)) &&
-	    (use_precommitted || !*consistent || !(correct_vg->status & INCONSISTENT_VG))) {
-		if (!(correct_vg->status & INCONSISTENT_VG))
-			*consistent = 1;
-		else	/* Inconsistent but we can't repair it */
-			correct_vg->status &= ~INCONSISTENT_VG;
-
+	    (use_precommitted || !*consistent)) {
+		*consistent = 1;
 		return correct_vg;
 	} else {
 		free_vg(correct_vg);
@@ -3131,8 +3127,7 @@
 	 * If there is no precommitted metadata, committed metadata
 	 * is read and stored in the cache even if use_precommitted is set
 	 */
-	lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED &
-			   (inconsistent ? INCONSISTENT_VG : 0));
+	lvmcache_update_vg(correct_vg, (correct_vg->status & PRECOMMITTED));
 
 	if (inconsistent) {
 		/* FIXME Test should be if we're *using* precommitted metadata not if we were searching for it */
--- LVM2/lib/metadata/metadata.h	2011/08/02 22:07:22	1.248
+++ LVM2/lib/metadata/metadata.h	2011/08/10 20:17:33	1.249
@@ -75,7 +75,6 @@
 //#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*/
 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2010-07-07  2:53 agk
  0 siblings, 0 replies; 16+ messages in thread
From: agk @ 2010-07-07  2:53 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@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

--- LVM2/WHATS_NEW	2010/07/07 02:37:28	1.1656
+++ LVM2/WHATS_NEW	2010/07/07 02:53:16	1.1657
@@ -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
 ===============================
--- LVM2/lib/metadata/metadata.c	2010/07/06 20:09:38	1.383
+++ LVM2/lib/metadata/metadata.c	2010/07/07 02:53:17	1.384
@@ -2899,6 +2899,7 @@
 	int inconsistent_vgid = 0;
 	int inconsistent_pvs = 0;
 	int inconsistent_seqno = 0;
+	int inconsistent_mdas = 0;
 	unsigned use_precommitted = precommitted;
 	unsigned saved_handles_missing_pvs = cmd->handles_missing_pvs;
 	struct dm_list *pvids;
@@ -2916,14 +2917,28 @@
 		return _vg_read_orphans(cmd, vgname);
 	}
 
-	if ((correct_vg = lvmcache_get_vg(vgid, precommitted))) {
+	/*
+	 * If cached metadata was inconsistent and *consistent is set
+	 * then repair it now.  Otherwise just return it.
+	 * Also return if use_precommitted is set due to the FIXME in
+	 * the missing PV logic below.
+	 */
+	if ((correct_vg = lvmcache_get_vg(vgid, precommitted)) &&
+	    (use_precommitted || !*consistent || !(correct_vg->status & INCONSISTENT_VG))) {
+		if (!(correct_vg->status & INCONSISTENT_VG))
+			*consistent = 1;
+		else	/* Inconsistent but we can't repair it */
+			correct_vg->status &= ~INCONSISTENT_VG;
+
 		if (vg_missing_pv_count(correct_vg)) {
 			log_verbose("There are %d physical volumes missing.",
 				    vg_missing_pv_count(correct_vg));
 			vg_mark_partial_lvs(correct_vg);
 		}
-		*consistent = 1;
 		return correct_vg;
+	} else {
+		vg_release(correct_vg);
+		correct_vg = NULL;
 	}
 
 	/* Find the vgname in the cache */
@@ -3009,14 +3024,29 @@
 				 * not ignored.
 				 */
 				if (!(info = info_from_pvid(pvl->pv->dev->pvid, 1)) ||
-				   !info->vginfo || !is_orphan_vg(info->vginfo->vgname) ||
-				   !mdas_empty_or_ignored(&info->mdas)) {
+				   !info->vginfo || !is_orphan_vg(info->vginfo->vgname)) {
 					inconsistent_pvs = 1;
 					break;
 				}
-				if (dm_list_size(&info->mdas) &&
-				    !fid_add_mdas(fid, &info->mdas))
-					return_NULL;
+				if (dm_list_size(&info->mdas)) {
+					if (!fid_add_mdas(fid, &info->mdas))
+						return_NULL;
+					 
+					log_debug("Empty mda found for VG %s.", vgname);
+
+					if (inconsistent_mdas)
+						continue;
+
+					/*
+					 * If any newly-added mdas are in-use then their
+					 * metadata needs updating.
+					 */
+					dm_list_iterate_items(mda, &info->mdas)
+						if (!mda_is_ignored(mda)) {
+							inconsistent_mdas = 1;
+							break;
+						}
+				}
 			}
 
 			/* If the check passed, let's update VG and recalculate pvids */
@@ -3056,6 +3086,11 @@
 				break;
 			}
 		}
+
+		if (correct_vg && inconsistent_mdas) {
+			vg_release(correct_vg);
+			correct_vg = NULL;
+		}
 	}
 
 	dm_list_init(&all_pvs);
@@ -3132,7 +3167,8 @@
 	 * If there is no precommitted metadata, committed metadata
 	 * is read and stored in the cache even if use_precommitted is set
 	 */
-	lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED);
+	lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED &
+			   (inconsistent ? INCONSISTENT_VG : 0));
 
 	if (inconsistent) {
 		/* FIXME Test should be if we're *using* precommitted metadata not if we were searching for it */
--- LVM2/lib/metadata/metadata.h	2010/06/30 13:51:13	1.214
+++ LVM2/lib/metadata/metadata.h	2010/07/07 02:53:17	1.215
@@ -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*/
 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2010-03-31 17:21 mbroz
  0 siblings, 0 replies; 16+ messages in thread
From: mbroz @ 2010-03-31 17:21 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-03-31 17:21:41

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

Log message:
	Optimise PV segments search.
	
	The function find_peg_by_pe is incredibly inefficient
	for Pvs with many segments.
	
	In shiny future there should be binary (or interval) tree
	instead of sorted linked list (volunteers?).
	
	Anyway, for now, we can use dirty trick here to optimise this case:
	
	- Allocations are usually applied from the beginning
	of PV (we have no alloocation policy which allocates areas
	"backwards")
	
	- The only user of find_peg_by_pe is pv_split_segment()
	call. In *most* cases it need to split *last* PV segment.
	
	So if we search sorted pv segment list backwards, we
	hit the requested segment immediatelly.
	
	This patch applies this tiny change.
	(and saves >30% of processing time when >3000LVs segments are on one PV!)
	
	To discourage using this inefficient function from other code,
	it is moved to pv_manip.c and used static for now:-)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1494&r2=1.1495
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.325&r2=1.326
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.200&r2=1.201
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23

--- LVM2/WHATS_NEW	2010/03/31 17:20:44	1.1494
+++ LVM2/WHATS_NEW	2010/03/31 17:21:40	1.1495
@@ -1,5 +1,6 @@
 Version 2.02.63 -  
 ================================
+  Optimise PV segments search for the most last segment search case.
   Remove vg_validate call when parsing cached metadata.
   Use hash table of LVs to speed up parsing of text metadata with many LVs.
   Fix two messages, add a whitespace and parentheses
--- LVM2/lib/metadata/metadata.c	2010/03/31 12:06:30	1.325
+++ LVM2/lib/metadata/metadata.c	2010/03/31 17:21:40	1.326
@@ -1799,18 +1799,6 @@
 	return NULL;
 }
 
-/* Find segment at a given physical extent in a PV */
-struct pv_segment *find_peg_by_pe(const struct physical_volume *pv, uint32_t pe)
-{
-	struct pv_segment *peg;
-
-	dm_list_iterate_items(peg, &pv->segments)
-		if (pe >= peg->pe && pe < peg->pe + peg->len)
-			return peg;
-
-	return NULL;
-}
-
 int vg_remove_mdas(struct volume_group *vg)
 {
 	struct metadata_area *mda;
--- LVM2/lib/metadata/metadata.h	2010/02/14 03:21:06	1.200
+++ LVM2/lib/metadata/metadata.h	2010/03/31 17:21:40	1.201
@@ -308,9 +308,6 @@
 /* Find LV segment containing given LE */
 struct lv_segment *find_seg_by_le(const struct logical_volume *lv, uint32_t le);
 
-/* Find PV segment containing given LE */
-struct pv_segment *find_peg_by_pe(const struct physical_volume *pv, uint32_t pe);
-
 /*
  * Remove a dev_dir if present.
  */
--- LVM2/lib/metadata/pv_manip.c	2008/11/03 22:14:29	1.22
+++ LVM2/lib/metadata/pv_manip.c	2010/03/31 17:21:40	1.23
@@ -78,6 +78,20 @@
 	return 1;
 }
 
+/* Find segment at a given physical extent in a PV */
+static struct pv_segment *find_peg_by_pe(const struct physical_volume *pv,
+					 uint32_t pe)
+{
+	struct pv_segment *pvseg;
+
+	/* search backwards to optimise mostly used last segment split */
+	dm_list_iterate_back_items(pvseg, &pv->segments)
+		if (pe >= pvseg->pe && pe < pvseg->pe + pvseg->len)
+			return pvseg;
+
+	return NULL;
+}
+
 /*
  * Split peg at given extent.
  * Second part is always deallocated.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2009-03-16 14:35 mbroz
  0 siblings, 0 replies; 16+ messages in thread
From: mbroz @ 2009-03-16 14:35 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-03-16 14:34:58

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c snapshot_manip.c 
	test           : t-lvcreate-usage.sh 
	tools          : lvcreate.c vgck.c 

Log message:
	Fix lv_count when manipulating with snapshots and max_lv is set.
	
	Patch fixes these problems:
	- during the snapshot creation process, it needs create 2 LVs,
	one is cow, second becomes snapshot.
	If the code fails in vg_add_snapshot, code lvcreate will not remove
	LV cow volume.
	
	- if max_lv is set and VG contains snapshot, it can happen that
	during the activation lv_count is temporarily increased over the limit
	and VG metadata are not properly processed
	see https://bugzilla.redhat.com/show_bug.cgi?id=490298
	
	- vgcfgrestore alows restore with max_lv set to lower valuer that actual
	LV count. This later leads to situation that max_lv is completely ignored.
	
	- vgck doesn't call vg_validate(). It should at least try:-)
	
	Signed-off-by: Milan Broz <mbroz@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1065&r2=1.1066
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.206&r2=1.207
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.179&r2=1.180
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgck.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19

--- LVM2/WHATS_NEW	2009/03/09 15:42:10	1.1065
+++ LVM2/WHATS_NEW	2009/03/16 14:34:57	1.1066
@@ -1,5 +1,7 @@
 Version 2.02.46 - 
 ================================
+  Fix maximal volume count check for snapshots if max_lv set for volume group.
+  Fix lvcreate to remove cow volume if the snapshot creation fails.
   Fix error messages when PV uuid or pe_start reading fails.
   Rename liblvm.a to liblvm-internal.a and build new application library.
   Flush memory pool and fix locking in clvmd refresh and backup command.
--- LVM2/lib/metadata/metadata.c	2009/02/25 23:29:06	1.206
+++ LVM2/lib/metadata/metadata.c	2009/03/16 14:34:58	1.207
@@ -1461,6 +1461,13 @@
 		r = 0;
 	}
 
+	if (vg->max_lv && (vg->max_lv < vg->lv_count)) {
+		log_error("Internal error: Volume group %s contains %u volumes"
+			  " but the limit is set to %u.",
+			  vg->name, vg->lv_count, vg->max_lv);
+		r = 0;
+	}
+
 	return r;
 }
 
--- LVM2/lib/metadata/snapshot_manip.c	2008/12/04 15:54:27	1.33
+++ LVM2/lib/metadata/snapshot_manip.c	2009/03/16 14:34:58	1.34
@@ -76,10 +76,18 @@
 		return 0;
 	}
 
+	/*
+	 * Set origin lv count in advance to prevent fail because
+	 * of temporary violation of LV limits.
+	 */
+	origin->vg->lv_count--;
+
 	if (!(snap = lv_create_empty(name ? name : "snapshot%d",
 				     lvid, LVM_READ | LVM_WRITE | VISIBLE_LV,
-				     ALLOC_INHERIT, 1, origin->vg)))
+				     ALLOC_INHERIT, 1, origin->vg))) {
+		origin->vg->lv_count++;
 		return_0;
+	}
 
 	snap->le_count = extent_count;
 
@@ -93,7 +101,6 @@
 
 	origin->origin_count++;
 	origin->vg->snapshot_count++;
-	origin->vg->lv_count--;
 	cow->snapshot = seg;
 
 	cow->status &= ~VISIBLE_LV;
--- LVM2/test/t-lvcreate-usage.sh	2008/11/10 12:37:03	1.9
+++ LVM2/test/t-lvcreate-usage.sh	2009/03/16 14:34:58	1.10
@@ -58,3 +58,12 @@
 grep "^  Invalid stripe size 3\.00 KB\$" err
 case $(lvdisplay $vg) in "") true ;; *) false ;; esac
 
+# Setting max_lv works. (bz490298)
+vgchange -l 4 $vg
+lvcreate -l1 -n $lv1 $vg
+lvcreate -l1 -s -n $lv2 $vg/$lv1
+lvcreate -l1 -n $lv3 $vg
+not lvcreate -l1 -n $lv4 $vg
+vgs $vg
+lvremove -ff $vg
+vgchange -l 0 $vg
--- LVM2/tools/lvcreate.c	2009/02/28 20:04:25	1.179
+++ LVM2/tools/lvcreate.c	2009/03/16 14:34:58	1.180
@@ -836,7 +836,7 @@
 		if (!vg_add_snapshot(NULL, org, lv, NULL,
 				     org->le_count, lp->chunk_size)) {
 			log_error("Couldn't create snapshot.");
-			return 0;
+			goto deactivate_and_revert_new_lv;
 		}
 
 		/* store vg on disk(s) */
--- LVM2/tools/vgck.c	2008/01/30 14:00:02	1.18
+++ LVM2/tools/vgck.c	2009/03/16 14:34:58	1.19
@@ -33,6 +33,9 @@
 	if (!vg_check_status(vg, EXPORTED_VG))
 		return ECMD_FAILED;
 
+	if (!vg_validate(vg))
+		return ECMD_FAILED;
+
 	return ECMD_PROCESSED;
 }
 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2008-06-23 19:04 wysochanski
  0 siblings, 0 replies; 16+ messages in thread
From: wysochanski @ 2008-06-23 19:04 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2008-06-23 19:04:34

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

Log message:
	Add uninitialized_var macro to suppress invalid compiler warnings.
	
	One such warning is seen on fedora9 gcc compiler:
	/metadata.c:1923: warning: 'results' may be used uninitialized in this function

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.912&r2=1.913
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.181&r2=1.182
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/util.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5

--- LVM2/WHATS_NEW	2008/06/23 14:54:49	1.912
+++ LVM2/WHATS_NEW	2008/06/23 19:04:34	1.913
@@ -1,5 +1,6 @@
 Version 2.02.39 -
 ================================
+  Add uninitialzed_var() macro to suppress invalid compiler warnings.
   Suppress 'sb_offset' compiler warning by using enum for md minor sb version. 
   lvm2_run: Don't return uninitialized "ret" for _memlock_inc or _memlock_dec.
   Avoid link failure when configuring without --enable-cmdlib.
--- LVM2/lib/metadata/metadata.c	2008/06/08 14:18:44	1.181
+++ LVM2/lib/metadata/metadata.c	2008/06/23 19:04:34	1.182
@@ -1920,7 +1920,7 @@
 static int _get_pvs(struct cmd_context *cmd, struct list **pvslist)
 {
 	struct str_list *strl;
-	struct list *results;
+	struct list * uninitialized_var(results);
 	const char *vgname, *vgid;
 	struct list *pvh, *tmp;
 	struct list *vgids;
--- LVM2/lib/misc/util.h	2007/10/03 16:10:04	1.4
+++ LVM2/lib/misc/util.h	2008/06/23 19:04:34	1.5
@@ -25,4 +25,6 @@
 		     (void) (&_a == &_b); \
 		     _a > _b ? _a : _b; })
 
+#define uninitialized_var(x) x = x
+
 #endif


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2008-04-22 12:54 agk
  0 siblings, 0 replies; 16+ messages in thread
From: agk @ 2008-04-22 12:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-04-22 12:54:33

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

Log message:
	Check lv_count in vg_validate.
	Fix internal LV counter when a snapshot is removed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.856&r2=1.857
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.171&r2=1.172
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.153&r2=1.154

--- LVM2/WHATS_NEW	2008/04/22 11:47:22	1.856
+++ LVM2/WHATS_NEW	2008/04/22 12:54:32	1.857
@@ -1,5 +1,7 @@
 Version 2.02.36 - 
 =================================
+  Check lv_count in vg_validate.
+  Fix internal LV counter when a snapshot is removed.
   Fix metadata corruption writing lvm1-formatted metadata with snapshots.
   Add --prefixes to reporting tools for field name prefix output format.
   Fix lvconvert -m0 allocatable space check.
--- LVM2/lib/metadata/metadata.c	2008/04/15 14:46:19	1.171
+++ LVM2/lib/metadata/metadata.c	2008/04/22 12:54:33	1.172
@@ -1177,6 +1177,7 @@
 	struct lv_list *lvl, *lvl2;
 	char uuid[64] __attribute((aligned(8)));
 	int r = 1;
+	uint32_t lv_count;
 
 	/* FIXME Also check there's no data/metadata overlap */
 
@@ -1210,6 +1211,15 @@
 		r = 0;
 	}
 
+	if ((lv_count = (uint32_t) list_size(&vg->lvs)) !=
+	    vg->lv_count + 2 * vg->snapshot_count) {
+		log_error("Internal error: #internal LVs (%u) != #LVs (%"
+			  PRIu32 ") + 2 * #snapshots (%" PRIu32 ") in VG %s",
+			  list_size(&vg->lvs), vg->lv_count,
+			  vg->snapshot_count, vg->name);
+		r = 0;
+	}
+
 	list_iterate_items(lvl, &vg->lvs) {
 		list_iterate_items(lvl2, &vg->lvs) {
 			if (lvl == lvl2)
--- LVM2/lib/metadata/lv_manip.c	2008/04/10 17:09:31	1.153
+++ LVM2/lib/metadata/lv_manip.c	2008/04/22 12:54:33	1.154
@@ -439,7 +439,8 @@
 
 		list_del(&lvl->list);
 
-		lv->vg->lv_count--;
+		if (!(lv->status & SNAPSHOT))
+			lv->vg->lv_count--;
 	} else if (lv->vg->fid->fmt->ops->lv_setup &&
 		   !lv->vg->fid->fmt->ops->lv_setup(lv->vg->fid, lv))
 		return_0;


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2007-07-12 15:38 wysochanski
  0 siblings, 0 replies; 16+ messages in thread
From: wysochanski @ 2007-07-12 15:38 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2007-07-12 15:38:53

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

Log message:
	Change pv_read_path to pv_by_path

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.654&r2=1.655
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.126&r2=1.127
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.168&r2=1.169

--- LVM2/WHATS_NEW	2007/07/12 05:04:39	1.654
+++ LVM2/WHATS_NEW	2007/07/12 15:38:52	1.655
@@ -1,7 +1,7 @@
 Version 2.02.27 - 
 ================================
   Turn _add_pv_to_vg() into external library function add_pv_to_vg().
-  Add pv_read_path() external library function.
+  Add pv_by_path() external library function.
   Tidy clvmd-openais of redundant bits, and improve an error report.
   Cope with find_seg_by_le() failure in check_lv_segments().
   Call dev_iter_destroy() if _process_all_devs() is interrupted by sigint.
--- LVM2/lib/metadata/metadata.c	2007/07/12 05:04:41	1.126
+++ LVM2/lib/metadata/metadata.c	2007/07/12 15:38:53	1.127
@@ -255,7 +255,7 @@
 
 	/* attach each pv */
 	for (i = 0; i < pv_count; i++) {
-		if (!(pv = pv_read_path(vg->fid->fmt->cmd, pv_names[i]))) {
+		if (!(pv = pv_by_path(vg->fid->fmt->cmd, pv_names[i]))) {
 			log_error("%s not identified as an existing "
 				  "physical volume", pv_names[i]);
 			goto bad;
@@ -1858,7 +1858,7 @@
 
 
 /**
- * pv_read_path - Given a device path return a PV handle if it is a PV
+ * pv_by_path - Given a device path return a PV handle if it is a PV
  * @cmd - handle to the LVM command instance
  * @pv_name - device path to read for the PV
  *
@@ -1866,8 +1866,9 @@
  *  NULL - device path does not contain a valid PV
  *  non-NULL - PV handle corresponding to device path
  *
+ * FIXME: merge with find_pv_by_name ?
  */
-pv_t *pv_read_path(struct cmd_context *cmd, const char *pv_name)
+pv_t *pv_by_path(struct cmd_context *cmd, const char *pv_name)
 {
 	struct list mdas;
 	
--- LVM2/lib/metadata/metadata.h	2007/07/12 05:04:42	1.168
+++ LVM2/lib/metadata/metadata.h	2007/07/12 15:38:53	1.169
@@ -654,7 +654,7 @@
 
 uint32_t vg_status(vg_t *vg);
 
-pv_t *pv_read_path(struct cmd_context *cmd, const char *pv_name);
+pv_t *pv_by_path(struct cmd_context *cmd, const char *pv_name);
 int add_pv_to_vg(struct volume_group *vg, const char *pv_name,
 		 struct physical_volume *pv);
 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2007-07-12  5:04 wysochanski
  0 siblings, 0 replies; 16+ messages in thread
From: wysochanski @ 2007-07-12  5:04 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2007-07-12 05:04:42

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

Log message:
	Turn _add_pv_to_vg() into external library function add_pv_to_vg()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.653&r2=1.654
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.125&r2=1.126
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.167&r2=1.168

--- LVM2/WHATS_NEW	2007/07/11 23:33:12	1.653
+++ LVM2/WHATS_NEW	2007/07/12 05:04:39	1.654
@@ -1,6 +1,7 @@
 Version 2.02.27 - 
 ================================
-  Add pv_read_path external library function.
+  Turn _add_pv_to_vg() into external library function add_pv_to_vg().
+  Add pv_read_path() external library function.
   Tidy clvmd-openais of redundant bits, and improve an error report.
   Cope with find_seg_by_le() failure in check_lv_segments().
   Call dev_iter_destroy() if _process_all_devs() is interrupted by sigint.
--- LVM2/lib/metadata/metadata.c	2007/07/12 04:12:04	1.125
+++ LVM2/lib/metadata/metadata.c	2007/07/12 05:04:41	1.126
@@ -66,10 +66,21 @@
 	return MAX(65536UL, lvm_getpagesize()) >> SECTOR_SHIFT;
 }
 
-static int _add_pv_to_vg(struct volume_group *vg, const char *pv_name)
+/**
+ * add_pv_to_vg - Add a physical volume to a volume group
+ * @vg - volume group to add to
+ * @pv_name - name of the pv (to be removed)
+ * @pv - physical volume to add to volume group
+ *
+ * Returns:
+ *  0 - failure
+ *  1 - success
+ * FIXME: remove pv_name - obtain safely from pv
+ */
+int add_pv_to_vg(struct volume_group *vg, const char *pv_name,
+		 struct physical_volume *pv)
 {
 	struct pv_list *pvl;
-	struct physical_volume *pv;
 	struct format_instance *fid = vg->fid;
 	struct dm_pool *mem = fid->fmt->cmd->mem;
 
@@ -81,12 +92,6 @@
 		return 0;
 	}
 
-	if (!(pv = pv_read_path(fid->fmt->cmd, pv_name))) {
-		log_error("%s not identified as an existing physical volume",
-			  pv_name);
-		return 0;
-	}
-
 	if (*pv->vg_name) {
 		log_error("Physical volume '%s' is already in volume group "
 			  "'%s'", pv_name, pv->vg_name);
@@ -246,11 +251,19 @@
 int vg_extend(struct volume_group *vg, int pv_count, char **pv_names)
 {
 	int i;
+	struct physical_volume *pv;
 
 	/* attach each pv */
-	for (i = 0; i < pv_count; i++)
-		if (!_add_pv_to_vg(vg, pv_names[i]))
+	for (i = 0; i < pv_count; i++) {
+		if (!(pv = pv_read_path(vg->fid->fmt->cmd, pv_names[i]))) {
+			log_error("%s not identified as an existing "
+				  "physical volume", pv_names[i]);
 			goto bad;
+		}
+		
+		if (!add_pv_to_vg(vg, pv_names[i], pv))
+			goto bad;
+	}
 
 /* FIXME Decide whether to initialise and add new mdahs to format instance */
 
@@ -1854,7 +1867,7 @@
  *  non-NULL - PV handle corresponding to device path
  *
  */
-pv_t *pv_read_path(const struct cmd_context *cmd, const char *pv_name)
+pv_t *pv_read_path(struct cmd_context *cmd, const char *pv_name)
 {
 	struct list mdas;
 	
--- LVM2/lib/metadata/metadata.h	2007/07/11 23:33:12	1.167
+++ LVM2/lib/metadata/metadata.h	2007/07/12 05:04:42	1.168
@@ -654,6 +654,8 @@
 
 uint32_t vg_status(vg_t *vg);
 
-pv_t *pv_read_path(const struct cmd_context *cmd, const char *pv_name);
+pv_t *pv_read_path(struct cmd_context *cmd, const char *pv_name);
+int add_pv_to_vg(struct volume_group *vg, const char *pv_name,
+		 struct physical_volume *pv);
 
 #endif


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2007-07-11 23:33 wysochanski
  0 siblings, 0 replies; 16+ messages in thread
From: wysochanski @ 2007-07-11 23:33 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2007-07-11 23:33:12

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

Log message:
	Add pv_read_path, a proposed external LVM library function to take a device path and return a PV handle

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.652&r2=1.653
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.166&r2=1.167

--- LVM2/WHATS_NEW	2007/07/11 12:07:39	1.652
+++ LVM2/WHATS_NEW	2007/07/11 23:33:12	1.653
@@ -1,5 +1,6 @@
 Version 2.02.27 - 
 ================================
+  Add pv_read_path external library function.
   Tidy clvmd-openais of redundant bits, and improve an error report.
   Cope with find_seg_by_le() failure in check_lv_segments().
   Call dev_iter_destroy() if _process_all_devs() is interrupted by sigint.
--- LVM2/lib/metadata/metadata.c	2007/07/02 21:48:30	1.123
+++ LVM2/lib/metadata/metadata.c	2007/07/11 23:33:12	1.124
@@ -72,7 +72,6 @@
 	struct physical_volume *pv;
 	struct format_instance *fid = vg->fid;
 	struct dm_pool *mem = fid->fmt->cmd->mem;
-	struct list mdas;
 
 	log_verbose("Adding physical volume '%s' to volume group '%s'",
 		    pv_name, vg->name);
@@ -82,8 +81,7 @@
 		return 0;
 	}
 
-	list_init(&mdas);
-	if (!(pv = _pv_read(fid->fmt->cmd, pv_name, &mdas, NULL, 1))) {
+	if (!(pv = pv_read_path(fid->fmt->cmd, pv_name))) {
 		log_error("%s not identified as an existing physical volume",
 			  pv_name);
 		return 0;
@@ -1842,3 +1840,22 @@
 {
 	return vg->status;
 }
+
+
+/**
+ * pv_read_path - Given a device path return a PV handle if it is a PV
+ * @cmd - handle to the LVM command instance
+ * @pv_name - device path to read for the PV
+ *
+ * Returns:
+ *  NULL - device path does not contain a valid PV
+ *  non-NULL - PV handle corresponding to device path
+ *
+ */
+pv_t *pv_read_path(const struct cmd_context *cmd, const char *pv_name)
+{
+	struct list mdas;
+	
+	list_init(&mdas);
+	return _pv_read(cmd, pv_name, &mdas, NULL, 1);
+}
--- LVM2/lib/metadata/metadata.h	2007/06/19 04:36:12	1.166
+++ LVM2/lib/metadata/metadata.h	2007/07/11 23:33:12	1.167
@@ -638,7 +638,7 @@
 		       char *buffer, size_t len);
 
 /*
- * Gets/Sets for external LVM library
+ * Begin skeleton for external LVM library
  */
 struct id pv_id(pv_t *pv);
 const struct format_type *pv_format_type(pv_t *pv);
@@ -654,4 +654,6 @@
 
 uint32_t vg_status(vg_t *vg);
 
+pv_t *pv_read_path(const struct cmd_context *cmd, const char *pv_name);
+
 #endif


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2007-06-06 19:40 wysochanski
  0 siblings, 0 replies; 16+ messages in thread
From: wysochanski @ 2007-06-06 19:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2007-06-06 19:40:28

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c metadata.h 
	tools          : lvconvert.c lvcreate.c lvrename.c lvresize.c 
	                 pvchange.c pvdisplay.c pvmove.c pvresize.c 
	                 reporter.c toollib.c vgextend.c vgmerge.c 
	                 vgreduce.c vgrename.c vgsplit.c 

Log message:
	Add vg_check_status to consolidate vg status flags checks and error messages.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.623&r2=1.624
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.156&r2=1.157
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.134&r2=1.135
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvrename.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvdisplay.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvresize.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.98&r2=1.99
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgrename.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26

--- LVM2/WHATS_NEW	2007/05/31 14:19:57	1.623
+++ LVM2/WHATS_NEW	2007/06/06 19:40:27	1.624
@@ -1,5 +1,6 @@
 Version 2.02.26 -
 =================================
+  Add vg_check_status to consolidate vg status checks and error messages.
   Add pvdisplay --maps implementation.
   Fix vgcfgrestore man pg to show mandatory VG name and remove LVM1 options.
   Fix vgrename man page to include UUID and be consistent with lvrename.
--- LVM2/lib/metadata/metadata.c	2007/04/26 16:44:59	1.108
+++ LVM2/lib/metadata/metadata.c	2007/06/06 19:40:27	1.109
@@ -24,6 +24,7 @@
 #include "pv_alloc.h"
 #include "activate.h"
 #include "display.h"
+#include "locking.h"
 
 #include <sys/param.h>
 
@@ -1593,3 +1594,44 @@
 
 	return 1;
 }
+
+
+
+/**
+ * vg_check_status - check volume group status flags and log error
+ *
+ * @vg - volume group to check status flags
+ * @status_flags - specific status flags to check (e.g. EXPORTED_VG)
+ *
+ * Returns:
+ * 0 - fail
+ * 1 - success
+ */
+int vg_check_status(struct volume_group *vg, uint32_t status_flags)
+{
+	if ((status_flags & CLUSTERED) &&
+	    (vg->status & CLUSTERED) && !locking_is_clustered() &&
+	    !lockingfailed()) {
+		log_error("Skipping clustered volume group %s", vg->name);
+		return 0;
+	}
+
+	if ((status_flags & EXPORTED_VG) &&
+	    (vg->status & EXPORTED_VG)) {
+		log_error("Volume group %s is exported", vg->name);
+		return 0;
+	}
+
+	if ((status_flags & LVM_WRITE) &&
+	    !(vg->status & LVM_WRITE)) {
+		log_error("Volume group %s is read-only", vg->name);
+		return 0;
+	}
+	if ((status_flags & RESIZEABLE_VG) &&
+	    !(vg->status & RESIZEABLE_VG)) {
+		log_error("Volume group %s is not resizeable.", vg->name);
+		return 0;
+	}
+
+	return 1;
+}
--- LVM2/lib/metadata/metadata.h	2007/04/25 21:10:55	1.156
+++ LVM2/lib/metadata/metadata.h	2007/06/06 19:40:27	1.157
@@ -578,6 +578,8 @@
 
 int vg_remove_snapshot(struct logical_volume *cow);
 
+int vg_check_status(struct volume_group *vg, uint32_t status_flags);
+
 /*
  * Mirroring functions
  */
--- LVM2/tools/lvconvert.c	2007/03/26 16:10:10	1.26
+++ LVM2/tools/lvconvert.c	2007/06/06 19:40:28	1.27
@@ -557,21 +557,8 @@
 		goto error;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", lp.vg_name);
+	if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE))
 		goto error;
-	}
-
-	if (vg->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", lp.vg_name);
-		goto error;
-	}
-
-	if (!(vg->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", lp.vg_name);
-		goto error;
-	}
 
 	if (!(lvl = find_lv_in_vg(vg, lp.lv_name))) {
 		log_error("Logical volume \"%s\" not found in "
--- LVM2/tools/lvcreate.c	2007/03/26 16:10:10	1.134
+++ LVM2/tools/lvcreate.c	2007/06/06 19:40:28	1.135
@@ -493,21 +493,8 @@
 		return 0;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", lp->vg_name);
+	if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE))
 		return 0;
-	}
-
-	if (vg->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", lp->vg_name);
-		return 0;
-	}
-
-	if (!(vg->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", lp->vg_name);
-		return 0;
-	}
 
 	if (lp->lv_name && find_lv_in_vg(vg, lp->lv_name)) {
 		log_error("Logical volume \"%s\" already exists in "
--- LVM2/tools/lvrename.c	2007/03/09 20:47:41	1.42
+++ LVM2/tools/lvrename.c	2007/06/06 19:40:28	1.43
@@ -109,21 +109,8 @@
 		goto error;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg->name);
+	if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE))
 		goto error;
-	}
-
-	if (vg->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", vg->name);
-		goto error;
-	}
-
-	if (!(vg->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", vg_name);
-		goto error;
-	}
 
 	if (find_lv_in_vg(vg, lv_name_new)) {
 		log_error("Logical volume \"%s\" already exists in "
--- LVM2/tools/lvresize.c	2006/09/26 09:35:43	1.76
+++ LVM2/tools/lvresize.c	2007/06/06 19:40:28	1.77
@@ -141,21 +141,8 @@
 		return ECMD_FAILED;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg->name);
+	if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE))
 		return ECMD_FAILED;
-	}
-
-	if (vg->status & EXPORTED_VG) {
-		log_error("Volume group %s is exported", vg->name);
-		return ECMD_FAILED;
-	}
-
-	if (!(vg->status & LVM_WRITE)) {
-		log_error("Volume group %s is read-only", lp->vg_name);
-		return ECMD_FAILED;
-	}
 
 	/* does LV exist? */
 	if (!(lvl = find_lv_in_vg(vg, lp->lv_name))) {
--- LVM2/tools/pvchange.c	2006/11/30 23:11:42	1.44
+++ LVM2/tools/pvchange.c	2007/06/06 19:40:28	1.45
@@ -67,21 +67,9 @@
 			return 0;
 		}
 
-		if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-		    !lockingfailed()) {
-			log_error("Skipping clustered volume group %s", vg->name);
-			return 0;
-		}
-
-		if (vg->status & EXPORTED_VG) {
-			unlock_vg(cmd, pv->vg_name);
-			log_error("Volume group \"%s\" is exported", vg->name);
-			return 0;
-		}
-
-		if (!(vg->status & LVM_WRITE)) {
+		if (!vg_check_status(vg,
+				     CLUSTERED | EXPORTED_VG | LVM_WRITE)) {
 			unlock_vg(cmd, pv->vg_name);
-			log_error("Volume group \"%s\" is read-only", vg->name);
 			return 0;
 		}
 
--- LVM2/tools/pvdisplay.c	2007/06/05 18:23:17	1.28
+++ LVM2/tools/pvdisplay.c	2007/06/06 19:40:28	1.29
@@ -37,10 +37,7 @@
 	                 goto out;
 	         }
 
-	         if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	             !lockingfailed()) {
-	                 log_error("Skipping clustered volume group %s",
-	                           vg->name);
+		 if (!vg_check_status(vg, CLUSTERED)) {
 	                 ret = ECMD_FAILED;
 	                 goto out;
 	         }
--- LVM2/tools/pvmove.c	2007/03/09 20:47:41	1.33
+++ LVM2/tools/pvmove.c	2007/06/06 19:40:28	1.34
@@ -66,20 +66,7 @@
 		return NULL;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vgname);
-		return NULL;
-	}
-
-	if (vg->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", vgname);
-		unlock_vg(cmd, vgname);
-		return NULL;
-	}
-
-	if (!(vg->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", vgname);
+	if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE)) {
 		unlock_vg(cmd, vgname);
 		return NULL;
 	}
--- LVM2/tools/pvresize.c	2006/09/02 01:18:17	1.3
+++ LVM2/tools/pvresize.c	2007/06/06 19:40:28	1.4
@@ -77,22 +77,8 @@
 			return ECMD_FAILED;
 		}
 
-		if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-		    !lockingfailed()) {
+		if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE)) {
 			unlock_vg(cmd, vg_name);
-			log_error("Skipping clustered volume group %s", vg->name);
-			return ECMD_FAILED;
-		}
-
-		if (vg->status & EXPORTED_VG) {
-			unlock_vg(cmd, vg_name);
-			log_error("Volume group \"%s\" is exported", vg->name);
-			return ECMD_FAILED;
-		}
-
-		if (!(vg->status & LVM_WRITE)) {
-			unlock_vg(cmd, pv->vg_name);
-			log_error("Volume group \"%s\" is read-only", vg->name);
 			return ECMD_FAILED;
 		}
 
--- LVM2/tools/reporter.c	2007/02/14 15:18:31	1.21
+++ LVM2/tools/reporter.c	2007/06/06 19:40:28	1.22
@@ -71,9 +71,7 @@
 		goto out;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg->name);
+	if (!vg_check_status(vg, CLUSTERED)) {
 		ret = ECMD_FAILED;
 		goto out;
 	}
@@ -119,10 +117,7 @@
 			goto out;
 		}
 
-		if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-		    !lockingfailed()) {
-			log_error("Skipping clustered volume group %s",
-				  vg->name);
+		if (!vg_check_status(vg, CLUSTERED)) {
 			ret = ECMD_FAILED;
 			goto out;
 		}
--- LVM2/tools/toollib.c	2007/03/26 16:10:10	1.98
+++ LVM2/tools/toollib.c	2007/06/06 19:40:28	1.99
@@ -357,11 +357,7 @@
 				log_error("Volume group \"%s\" "
 					  "not found", vgname);
 			else {
-				if ((vg->status & CLUSTERED) &&
-			    	    !locking_is_clustered() &&
-				    !lockingfailed()) {
-					log_error("Skipping clustered volume "
-						  "group %s", vgname);
+				if (!vg_check_status(vg, CLUSTERED)) {
 					if (ret_max < ECMD_FAILED)
 						ret_max = ECMD_FAILED;
 					continue;
@@ -377,10 +373,8 @@
 			}
 		}
 
-		if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-		    !lockingfailed()) {
+		if (!vg_check_status(vg, CLUSTERED)) {
 			unlock_vg(cmd, vgname);
-			log_error("Skipping clustered volume group %s", vgname);
 			if (ret_max < ECMD_FAILED)
 				ret_max = ECMD_FAILED;
 			continue;
@@ -485,9 +479,7 @@
 		return ECMD_FAILED;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg_name);
+	if (!vg_check_status(vg, CLUSTERED)) {
 		unlock_vg(cmd, vg_name);
 		return ECMD_FAILED;
 	}
@@ -735,13 +727,8 @@
 				if (!consistent)
 					continue;
 
-				if ((vg->status & CLUSTERED) &&
-				    !locking_is_clustered() &&
-				    !lockingfailed()) {
-					log_error("Skipping clustered volume "
-						  "group %s", sll->str);
+				if (!vg_check_status(vg, CLUSTERED))
 					continue;
-				}
 
 				ret = process_each_pv_in_vg(cmd, vg, &tags,
 							    handle,
--- LVM2/tools/vgextend.c	2007/03/09 21:25:33	1.29
+++ LVM2/tools/vgextend.c	2007/06/06 19:40:28	1.30
@@ -59,26 +59,9 @@
 		goto error;
 	}
 
-	if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg->name);
+	if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG |
+				 LVM_WRITE | RESIZEABLE_VG))
 		goto error;
-	}
-
-	if (vg->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", vg->name);
-		goto error;
-	}
-
-	if (!(vg->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", vg_name);
-		goto error;
-	}
-
-	if (!(vg->status & RESIZEABLE_VG)) {
-		log_error("Volume group \"%s\" is not resizeable.", vg_name);
-		goto error;
-	}
 
 /********** FIXME
 	log_print("maximum logical volume size is %s",
--- LVM2/tools/vgmerge.c	2007/03/09 20:47:41	1.36
+++ LVM2/tools/vgmerge.c	2007/06/06 19:40:28	1.37
@@ -41,21 +41,7 @@
 		return ECMD_FAILED;
 	}
 
-	if ((vg_to->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg_name_to);
-		unlock_vg(cmd, vg_name_to);
-		return ECMD_FAILED;
-	}
-
-	if (vg_to->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", vg_to->name);
-		unlock_vg(cmd, vg_name_to);
-		return ECMD_FAILED;
-	}
-
-	if (!(vg_to->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", vg_to->name);
+	if (!vg_check_status(vg_to, CLUSTERED | EXPORTED_VG | LVM_WRITE)) {
 		unlock_vg(cmd, vg_name_to);
 		return ECMD_FAILED;
 	}
@@ -73,21 +59,8 @@
 		goto error;
 	}
 
-        if ((vg_from->status & CLUSTERED) && !locking_is_clustered() &&
-            !lockingfailed()) {
-                log_error("Skipping clustered volume group %s", vg_name_from);
+	if (!vg_check_status(vg_from, CLUSTERED | EXPORTED_VG | LVM_WRITE))
                 goto error;
-        }
-
-	if (vg_from->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", vg_from->name);
-		goto error;
-	}
-
-	if (!(vg_from->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", vg_from->name);
-		goto error;
-	}
 
 	if ((active = lvs_in_vg_activated(vg_from))) {
 		log_error("Logical volumes in \"%s\" must be inactive",
--- LVM2/tools/vgreduce.c	2007/03/09 21:25:33	1.58
+++ LVM2/tools/vgreduce.c	2007/06/06 19:40:28	1.59
@@ -484,9 +484,7 @@
 		return ECMD_FAILED;
 	}
 
-	if (vg && (vg->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg->name);
+	if (vg && !vg_check_status(vg, CLUSTERED)) {
 		unlock_vg(cmd, vg_name);
 		return ECMD_FAILED;
 	}
@@ -506,10 +504,7 @@
 			unlock_vg(cmd, vg_name);
 			return ECMD_FAILED;
 		}
-		if ((vg->status & CLUSTERED) && !locking_is_clustered() &&
-		    !lockingfailed()) {
-			log_error("Skipping clustered volume group %s",
-				  vg->name);
+		if (!vg_check_status(vg, CLUSTERED)) {
 			unlock_vg(cmd, vg_name);
 			return ECMD_FAILED;
 		}
--- LVM2/tools/vgrename.c	2007/03/09 20:47:41	1.43
+++ LVM2/tools/vgrename.c	2007/06/06 19:40:28	1.44
@@ -102,21 +102,13 @@
 		return ECMD_FAILED;
 	}
 
-	if ((vg_old->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg_old->name);
+	if (!vg_check_status(vg_old, CLUSTERED | LVM_WRITE)) {
 		unlock_vg(cmd, vg_name_old);
 		return ECMD_FAILED;
 	}
 
-	if (vg_old->status & EXPORTED_VG)
-		log_info("Volume group \"%s\" is exported", vg_old->name);
-
-	if (!(vg_old->status & LVM_WRITE)) {
-		unlock_vg(cmd, vg_name_old);
-		log_error("Volume group \"%s\" is read-only", vg_old->name);
-		return ECMD_FAILED;
-	}
+	/* Don't return failure for EXPORTED_VG */
+	vg_check_status(vg_old, EXPORTED_VG);
 
 	if (lvs_in_vg_activated_by_uuid_only(vg_old)) {
 		unlock_vg(cmd, vg_name_old);
--- LVM2/tools/vgsplit.c	2007/05/15 13:01:41	1.25
+++ LVM2/tools/vgsplit.c	2007/06/06 19:40:28	1.26
@@ -251,27 +251,8 @@
 		return ECMD_FAILED;
 	}
 
-	if ((vg_from->status & CLUSTERED) && !locking_is_clustered() &&
-	    !lockingfailed()) {
-		log_error("Skipping clustered volume group %s", vg_from->name);
-		unlock_vg(cmd, vg_name_from);
-		return ECMD_FAILED;
-	}
-
-	if (vg_from->status & EXPORTED_VG) {
-		log_error("Volume group \"%s\" is exported", vg_from->name);
-		unlock_vg(cmd, vg_name_from);
-		return ECMD_FAILED;
-	}
-
-	if (!(vg_from->status & RESIZEABLE_VG)) {
-		log_error("Volume group \"%s\" is not resizeable", vg_from->name);
-		unlock_vg(cmd, vg_name_from);
-		return ECMD_FAILED;
-	}
-
-	if (!(vg_from->status & LVM_WRITE)) {
-		log_error("Volume group \"%s\" is read-only", vg_from->name);
+	if (!vg_check_status(vg_from, CLUSTERED | EXPORTED_VG |
+				      RESIZEABLE_VG | LVM_WRITE)) {
 		unlock_vg(cmd, vg_name_from);
 		return ECMD_FAILED;
 	}


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2007-04-25 20:03 wysochanski
  0 siblings, 0 replies; 16+ messages in thread
From: wysochanski @ 2007-04-25 20:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2007-04-25 21:03:16

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c metadata.h 
	man            : pvck.8 
	tools          : commands.h pvck.c 

Log message:
	Update pvck to read labels on disk, with flexible --labelsector
	parameter.
	
	--

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.602&r2=1.603
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.105&r2=1.106
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.154&r2=1.155
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvck.8.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvck.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2

--- LVM2/WHATS_NEW	2007/04/25 18:24:19	1.602
+++ LVM2/WHATS_NEW	2007/04/25 20:03:15	1.603
@@ -1,5 +1,6 @@
 Version 2.02.25 -
 =================================
+  Update pvck to read labels on disk, with --labelsector parameter
   Add count_chars and count_chars_len functions
   Add /sys/block listings to lvm_dump.sh
   Make lvm_dump.sh list /dev recursively
--- LVM2/lib/metadata/metadata.c	2007/04/23 18:21:01	1.105
+++ LVM2/lib/metadata/metadata.c	2007/04/25 20:03:15	1.106
@@ -1555,3 +1555,35 @@
 
 	return 1;
 }
+/*
+ * Returns:
+ *  0 - fail
+ *  1 - success
+ */
+int pv_analyze(struct cmd_context *cmd, const char *pv_name,
+	       int64_t label_sector)
+{
+	struct label *label;
+	struct device *dev;
+
+	dev = dev_cache_get(pv_name, cmd->filter);
+	if (!dev) {
+		log_error("Device %s not found (or ignored by filtering).",
+			  pv_name);
+		return 0;
+	}
+
+	/*
+	 * First, scan for LVM labels.
+	 */
+	if (!label_read(dev, &label, label_sector)) {
+		log_error("Could not find LVM label on %s",
+			  pv_name);
+		return 0;
+	}
+
+	log_print("Found label on %s, sector %"PRIu64", type=%s",
+		  pv_name, label->sector, label->type);
+
+	return 1;
+}
--- LVM2/lib/metadata/metadata.h	2007/03/23 12:43:17	1.154
+++ LVM2/lib/metadata/metadata.h	2007/04/25 20:03:15	1.155
@@ -443,6 +443,8 @@
 				  uint64_t pvmetadatasize, struct list *mdas);
 int pv_resize(struct physical_volume *pv, struct volume_group *vg,
               uint32_t new_pe_count);
+int pv_analyze(struct cmd_context *cmd, const char *pv_name,
+	       int64_t label_sector);
 
 struct volume_group *vg_create(struct cmd_context *cmd, const char *name,
 			       uint32_t extent_size, uint32_t max_pv,
--- LVM2/man/pvck.8	2007/03/30 21:00:25	1.1
+++ LVM2/man/pvck.8	2007/04/25 20:03:15	1.2
@@ -3,11 +3,29 @@
 pvck \- check physical volume metadata
 .SH SYNOPSIS
 .B pvck
-[\-d/\-\-debug] [\-h/\-?/\-\-help] [\-v/\-\-verbose] [PhysicalVolume...]
+.RB [ \-d | \-\-debug ]
+.RB [ \-h | \-\-help ]
+.RB [ \-v | \-\-verbose ]
+.RB [ \-\-labelsector ]
+.IR PhysicalVolume " [" PhysicalVolume ...]
 .SH DESCRIPTION
 pvck checks physical volume LVM metadata for consistency.
 .SH OPTIONS
 See \fBlvm\fP for common options.
+.TP
+.BR \-\-labelsector " sector"
+By default, 4 sectors of \fBPhysicalVolume\fP are scanned for an LVM label,
+starting at sector 0.  This parameter allows you to specify a different
+starting sector for the scan and is useful for recovery situations.  For
+example, suppose the partition table is corrupted or lost on /dev/sda,
+but you suspect there was an LVM partition at approximately 100 MB.  This
+area of the disk may be scanned by using the \fB--labelsector\fP parameter
+with a value of 204800 (100 * 1024 * 1024 / 512 = 204800):
+.sp
+.BI "pvck --labelsector 204800 /dev/sda"
+.sp
+Note that a script can be used with \fB--labelsector\fP to automate the
+process of finding LVM labels.
 .SH SEE ALSO
 .BR lvm (8),
 .BR pvcreate (8),
--- LVM2/tools/commands.h	2007/03/30 21:00:26	1.95
+++ LVM2/tools/commands.h	2007/04/25 20:03:16	1.96
@@ -412,9 +412,12 @@
    "pvck "
    "\t[-d|--debug]\n"
    "\t[-h|--help]\n"
+   "\t[--labelsector sector] " "\n"
    "\t[-v|--verbose]\n"
    "\t[--version]" "\n"
-   "\tPhysicalVolume [PhysicalVolume...]\n" )
+   "\tPhysicalVolume [PhysicalVolume...]\n",
+
+   labelsector_ARG)
 
 xx(pvcreate,
    "Initialize physical volume(s) for use by LVM",
--- LVM2/tools/pvck.c	2007/03/30 21:00:26	1.1
+++ LVM2/tools/pvck.c	2007/04/25 20:03:16	1.2
@@ -15,16 +15,26 @@
 
 #include "tools.h"
 
-static int _pvck_single(struct cmd_context * cmd,
-			struct volume_group * vg,
-			struct physical_volume * pv,
-			void *handle)
-{
-	return ECMD_PROCESSED;
-}
-
 int pvck(struct cmd_context *cmd, int argc, char **argv)
 {
-	/* FIXME: Correlate findings of each PV */
-	return process_each_pv(cmd, argc, argv, NULL, NULL, _pvck_single);
+	int i;
+
+	/* FIXME: validate cmdline options */
+	/* FIXME: what does the cmdline look like? */
+	/*
+	 * Use what's on the cmdline directly, and avoid calling into
+	 * some of the other infrastructure functions, so as to avoid
+	 * hitting some of the lvmcache behavior, scanning other devices,
+	 * etc.
+	 */
+	for (i = 0; i < argc; i++) {
+		/* FIXME: warning and/or check if in use? */
+		log_verbose("Scanning %s", argv[i]);
+
+		pv_analyze(cmd, argv[i],
+			   arg_int64_value(cmd, labelsector_ARG,
+					   UINT64_C(0)));
+	}
+
+	return ECMD_PROCESSED;
 }


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2007-02-07 13:29 agk
  0 siblings, 0 replies; 16+ messages in thread
From: agk @ 2007-02-07 13:29 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-02-07 13:29:52

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

Log message:
	If a PV reappears after it was removed from its VG, make it an orphan.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.569&r2=1.570
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.102&r2=1.103
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.152&r2=1.153

--- LVM2/WHATS_NEW	2007/01/31 16:26:22	1.569
+++ LVM2/WHATS_NEW	2007/02/07 13:29:51	1.570
@@ -1,5 +1,7 @@
 Version 2.02.22 - 
 ===================================
+  If a PV reappears after it was removed from its VG, make it an orphan.
+  Don't update metadata automatically if VGIDs don't match.
   Fix some vgreduce --removemissing command line validation.
 
 Version 2.02.21 - 30th January 2007
--- LVM2/lib/metadata/metadata.c	2006/11/30 23:11:42	1.102
+++ LVM2/lib/metadata/metadata.c	2007/02/07 13:29:52	1.103
@@ -963,6 +963,30 @@
 	return vg;
 }
 
+static int _update_pv_list(struct list *all_pvs, struct volume_group *vg)
+{
+	struct pv_list *pvl, *pvl2;
+
+	list_iterate_items(pvl, &vg->pvs) {
+		list_iterate_items(pvl2, all_pvs) {
+			if (pvl->pv->dev == pvl2->pv->dev)
+				goto next_pv;
+		}
+		/* PV is not on list so add it.  Note that we don't copy it. */
+       		if (!(pvl2 = dm_pool_zalloc(vg->cmd->mem, sizeof(*pvl2)))) {
+			log_error("pv_list allocation for '%s' failed",
+				  dev_name(pvl->pv->dev));
+			return 0;
+		}
+		pvl2->pv = pvl->pv;
+		list_add(all_pvs, &pvl2->list);
+  next_pv:
+		;
+	}
+
+	return 1;
+}
+
 /* 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.
@@ -982,9 +1006,12 @@
 	struct volume_group *vg, *correct_vg = NULL;
 	struct metadata_area *mda;
 	int inconsistent = 0;
+	int inconsistent_vgid = 0;
 	int use_precommitted = precommitted;
 	struct list *pvids;
-	struct pv_list *pvl;
+	struct pv_list *pvl, *pvl2;
+	struct list all_pvs;
+	char uuid[64] __attribute((aligned(8)));
 
 	if (!*vgname) {
 		if (use_precommitted) {
@@ -1069,6 +1096,8 @@
 		}
 	}
 
+	list_init(&all_pvs);
+
 	/* Failed to find VG where we expected it - full scan and retry */
 	if (!correct_vg) {
 		inconsistent = 0;
@@ -1104,13 +1133,25 @@
 			}
 			if (!correct_vg) {
 				correct_vg = vg;
+				if (!_update_pv_list(&all_pvs, correct_vg))
+					return_NULL;
 				continue;
 			}
+
+			if (strncmp((char *)vg->id.uuid,
+			    (char *)correct_vg->id.uuid, ID_LEN)) {
+				inconsistent = 1;
+				inconsistent_vgid = 1;
+			}
+
 			/* FIXME Also ensure contents same - checksums same? */
 			if (correct_vg->seqno != vg->seqno) {
 				inconsistent = 1;
-				if (vg->seqno > correct_vg->seqno)
+				if (vg->seqno > correct_vg->seqno) {
+					if (!_update_pv_list(&all_pvs, vg))
+						return_NULL;
 					correct_vg = vg;
+				}
 			}
 		}
 
@@ -1143,17 +1184,42 @@
 			return correct_vg;
 		}
 
-		log_print("Inconsistent metadata copies found - updating "
-			  "to use version %u", correct_vg->seqno);
+		/* Don't touch if vgids didn't match */
+		if (inconsistent_vgid) {
+			log_error("Inconsistent metadata UUIDs found for "
+				  "volume group %s", vgname);
+			*consistent = 0;
+			return correct_vg;
+		}
+
+		log_print("Inconsistent metadata found for VG %s - updating "
+			  "to use version %u", vgname, correct_vg->seqno);
+
 		if (!vg_write(correct_vg)) {
 			log_error("Automatic metadata correction failed");
 			return NULL;
 		}
+
 		if (!vg_commit(correct_vg)) {
 			log_error("Automatic metadata correction commit "
 				  "failed");
 			return NULL;
 		}
+
+		list_iterate_items(pvl, &all_pvs) {
+			list_iterate_items(pvl2, &correct_vg->pvs) {
+				if (pvl->pv->dev == pvl2->pv->dev)
+					goto next_pv;
+			}
+			if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid)))
+				return_NULL;
+			log_error("Removing PV %s (%s) that no longer belongs to VG %s",
+				  dev_name(pvl->pv->dev), uuid, correct_vg->name);
+			if (!pv_write_orphan(cmd, pvl->pv))
+				return_NULL;
+      next_pv:
+			;
+		}
 	}
 
 	if ((correct_vg->status & PVMOVE) && !pvmove_mode()) {
@@ -1433,3 +1499,25 @@
 
 	return 1;
 }
+
+int pv_write_orphan(struct cmd_context *cmd, struct physical_volume *pv)
+{
+	const char *old_vg_name = pv->vg_name;
+
+	pv->vg_name = ORPHAN;
+	pv->status = ALLOCATABLE_PV;
+
+	if (!dev_get_size(pv->dev, &pv->size)) {
+		log_error("%s: Couldn't get size.", dev_name(pv->dev));
+		return 0;
+	}
+
+	if (!pv_write(cmd, pv, NULL, INT64_C(-1))) {
+		log_error("Failed to clear metadata from physical "
+			  "volume \"%s\" after removal from \"%s\"",
+			  dev_name(pv->dev), old_vg_name);
+		return 0;
+	}
+
+	return 1;
+}
--- LVM2/lib/metadata/metadata.h	2006/12/13 03:39:58	1.152
+++ LVM2/lib/metadata/metadata.h	2007/02/07 13:29:52	1.153
@@ -423,6 +423,7 @@
 
 int pv_write(struct cmd_context *cmd, struct physical_volume *pv,
 	     struct list *mdas, int64_t label_sector);
+int pv_write_orphan(struct cmd_context *cmd, struct physical_volume *pv);
 
 /* pe_start and pe_end relate to any existing data so that new metadata
  * areas can avoid overlap */


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2005-04-18 14:56 agk
  0 siblings, 0 replies; 16+ messages in thread
From: agk @ 2005-04-18 14:56 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-04-18 14:56:42

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c metadata.h 
	tools          : commands.h vgchange.c 

Log message:
	vgchange --physicalextentsize (but only if it's an exact fit - may need to
	use pvmove first)

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.226&r2=1.227
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.115&r2=1.116
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.67&r2=1.68
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46


^ permalink raw reply	[flat|nested] 16+ messages in thread

* LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
@ 2004-06-19 19:27 agk
  0 siblings, 0 replies; 16+ messages in thread
From: agk @ 2004-06-19 19:27 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-06-19 19:27:01

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c metadata.h 
	lib/report     : report.c 
	tools          : commands.h pvchange.c pvcreate.c pvremove.c 
	                 reporter.c toollib.c 

Log message:
	Display all filtered devices, not just PVs, with pvs -a.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.51&r2=1.52
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvcreate.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvremove.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-11-04 22:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23 12:02 LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m prajnoha
  -- strict thread matches above, loose matches on Subject: below --
2011-11-04 22:49 zkabelac
2011-08-10 20:17 zkabelac
2010-07-07  2:53 agk
2010-03-31 17:21 mbroz
2009-03-16 14:35 mbroz
2008-06-23 19:04 wysochanski
2008-04-22 12:54 agk
2007-07-12 15:38 wysochanski
2007-07-12  5:04 wysochanski
2007-07-11 23:33 wysochanski
2007-06-06 19:40 wysochanski
2007-04-25 20:03 wysochanski
2007-02-07 13:29 agk
2005-04-18 14:56 agk
2004-06-19 19:27 agk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).