public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW tools/pvchange.c
@ 2004-12-21 16:12 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2004-12-21 16:12 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-12-21 16:12:04

Modified files:
	.              : WHATS_NEW 
	tools          : pvchange.c 

Log message:
	Fix pvchange -x segfault with lvm2-format orphan.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.132&r2=1.133
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38


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

* LVM2 ./WHATS_NEW tools/pvchange.c
@ 2010-12-23 14:23 mbroz
  0 siblings, 0 replies; 5+ messages in thread
From: mbroz @ 2010-12-23 14:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-12-23 14:23:30

Modified files:
	.              : WHATS_NEW 
	tools          : pvchange.c 

Log message:
	Fix wrongly paired unlocking of global lock in pvchange. (2.02.66)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1855&r2=1.1856
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87

--- LVM2/WHATS_NEW	2010/12/22 15:36:41	1.1855
+++ LVM2/WHATS_NEW	2010/12/23 14:23:30	1.1856
@@ -1,5 +1,6 @@
 Version 2.02.80 - 
 ====================================
+  Fix wrongly paired unlocking of global lock in pvchange. (2.02.66)
   Add backtraces for backup and backup_remove fail paths.
   Detect errors from dm_task_set calls in _get_device_info (dmeventd).
   Add backtraces for archive and backup_locally in check_current_backup().
--- LVM2/tools/pvchange.c	2010/12/08 20:50:51	1.86
+++ LVM2/tools/pvchange.c	2010/12/23 14:23:30	1.87
@@ -288,9 +288,9 @@
 				unlock_and_free_vg(cmd, vg, sll->str);
 			}
 		}
+		unlock_vg(cmd, VG_GLOBAL);
 	}
 
-	unlock_vg(cmd, VG_GLOBAL);
 	log_print("%d physical volume%s changed / %d physical volume%s "
 		  "not changed",
 		  done, done == 1 ? "" : "s",


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

* LVM2 ./WHATS_NEW tools/pvchange.c
@ 2008-07-31 12:28 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2008-07-31 12:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-07-31 12:28:51

Modified files:
	.              : WHATS_NEW 
	tools          : pvchange.c 

Log message:
	Fix pvchange to handle PVs without mdas.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.937&r2=1.938
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61

--- LVM2/WHATS_NEW	2008/07/31 10:50:12	1.937
+++ LVM2/WHATS_NEW	2008/07/31 12:28:50	1.938
@@ -1,5 +1,6 @@
 Version 2.02.40 - 
 ================================
+  Fix pvchange to handle PVs without mdas.
   Refactor _text_pv_read and always return mda list if requested.
   Fix configure to work w/o readline unless --enable-readline used. (2.02.39)
   Remove is_lvm_partition template which has not yet been coded.
--- LVM2/tools/pvchange.c	2008/07/16 10:46:12	1.60
+++ LVM2/tools/pvchange.c	2008/07/31 12:28:51	1.61
@@ -54,7 +54,6 @@
 	}
 
 	/* If in a VG, must change using volume group. */
-	/* FIXME: handle PVs with no MDAs */
 	if (!is_orphan(pv)) {
 		vg_name = pv_vg_name(pv);
 
@@ -233,8 +232,6 @@
 	struct list *pvslist;
 	struct list mdas;
 
-	list_init(&mdas);
-
 	if (arg_count(cmd, allocatable_ARG) + arg_count(cmd, addtag_ARG) +
 	    arg_count(cmd, deltag_ARG) + arg_count(cmd, uuid_ARG) != 1) {
 		log_error("Please give exactly one option of -x, -uuid, "
@@ -256,12 +253,34 @@
 		log_verbose("Using physical volume(s) on command line");
 		for (; opt < argc; opt++) {
 			pv_name = argv[opt];
-			/* FIXME Read VG instead - pv_read will fail */
+			list_init(&mdas);
 			if (!(pv = pv_read(cmd, pv_name, &mdas, NULL, 1))) {
 				log_error("Failed to read physical volume %s",
 					  pv_name);
 				continue;
 			}
+			/*
+			 * If a PV has no MDAs it may appear to be an
+			 * orphan until the metadata is read off
+			 * another PV in the same VG.  Detecting this
+			 * means checking every VG by scanning every
+			 * PV on the system.
+			 */
+			if (is_orphan(pv) && !list_size(&mdas)) {
+				if (!scan_vgs_for_pvs(cmd)) {
+					log_error("Rescan for PVs without "
+						  "metadata areas failed.");
+					continue;
+				}
+				if (!(pv = pv_read(cmd, pv_name,
+						   NULL, NULL, 1))) {
+					log_error("Failed to read "
+						  "physical volume %s",
+						  pv_name);
+					continue;
+				}
+			}
+
 			total++;
 			done += _pvchange_single(cmd, pv, NULL);
 		}


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

* LVM2 ./WHATS_NEW tools/pvchange.c
@ 2008-07-16 10:46 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2008-07-16 10:46 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-07-16 10:46:12

Modified files:
	.              : WHATS_NEW 
	tools          : pvchange.c 

Log message:
	Fix pvchange -M1 -u to preserve existing extent locations when there's a VG.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.929&r2=1.930
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60

--- LVM2/WHATS_NEW	2008/07/15 00:25:51	1.929
+++ LVM2/WHATS_NEW	2008/07/16 10:46:12	1.930
@@ -1,5 +1,6 @@
 Version 2.02.40 - 
 ================================
+  Fix pvchange -M1 -u to preserve existing extent locations when there's a VG.
   Cease recognising snapshot-in-use percentages returned by early devt kernels.
   Add backward-compatible flags field to on-disk format_text metadata.
   Fix dmeventd monitoring libraries to link against liblvm2cmd again. (2.02.39)
--- LVM2/tools/pvchange.c	2008/02/06 15:47:28	1.59
+++ LVM2/tools/pvchange.c	2008/07/16 10:46:12	1.60
@@ -26,6 +26,9 @@
 	struct list mdas;
 	uint64_t sector;
 	uint32_t orig_pe_alloc_count;
+	/* FIXME Next three only required for format1. */
+	uint32_t orig_pe_count, orig_pe_size;
+	uint64_t orig_pe_start;
 
 	const char *pv_name = pv_dev_name(pv);
 	const char *tag = NULL;
@@ -171,6 +174,12 @@
 		if (!is_orphan(pv)) {
 			orig_vg_name = pv_vg_name(pv);
 			orig_pe_alloc_count = pv_pe_alloc_count(pv);
+
+			/* FIXME format1 pv_write doesn't preserve these. */
+			orig_pe_size = pv_pe_size(pv);
+			orig_pe_start = pv_pe_start(pv);
+			orig_pe_count = pv_pe_count(pv);
+
 			pv->vg_name = pv->fmt->orphan_vg_name;
 			pv->pe_alloc_count = 0;
 			if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) {
@@ -181,6 +190,10 @@
 			}
 			pv->vg_name = orig_vg_name;
 			pv->pe_alloc_count = orig_pe_alloc_count;
+
+			pv->pe_size = orig_pe_size;
+			pv->pe_start = orig_pe_start;
+			pv->pe_count = orig_pe_count;
 		}
 	}
 


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

* LVM2 ./WHATS_NEW tools/pvchange.c
@ 2005-05-24 17:38 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2005-05-24 17:38 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-05-24 17:38:26

Modified files:
	.              : WHATS_NEW 
	tools          : pvchange.c 

Log message:
	Fix non-orphan pvchange -u.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.246&r2=1.247
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40


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

end of thread, other threads:[~2010-12-23 14:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-21 16:12 LVM2 ./WHATS_NEW tools/pvchange.c agk
2005-05-24 17:38 agk
2008-07-16 10:46 agk
2008-07-31 12:28 agk
2010-12-23 14:23 mbroz

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).