All of lore.kernel.org
 help / color / mirror / Atom feed
* LVM2 lib/metadata/metadata.c tools/vgextend.c
@ 2010-07-07 18:59 wysochanski
  0 siblings, 0 replies; 2+ messages in thread
From: wysochanski @ 2010-07-07 18:59 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2010-07-07 18:59:46

Modified files:
	lib/metadata   : metadata.c 
	tools          : vgextend.c 

Log message:
	Add warning to vgextend and pvchange if metadataignore given on cmdline.
	
	Warn the user then change the value of vg_mda_copies.
	
	Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.384&r2=1.385
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56

--- LVM2/lib/metadata/metadata.c	2010/07/07 02:53:17	1.384
+++ LVM2/lib/metadata/metadata.c	2010/07/07 18:59:45	1.385
@@ -4396,8 +4396,13 @@
 	 * This does not guarantee this PV's ignore bits will be
 	 * preserved in future operations.
 	 */
-	if (!is_orphan(pv) && vg_mda_copies(pv->vg))
+	if (!is_orphan(pv) &&
+	    vg_mda_copies(pv->vg) != VGMETADATACOPIES_UNMANAGED) {
+		log_warn("WARNING: Changing preferred number of copies of VG %s "
+			 "metadata from %"PRIu32" to %"PRIu32, pv_vg_name(pv),
+			 vg_mda_copies(pv->vg), vg_mda_used_count(pv->vg));
 		vg_set_mda_copies(pv->vg, vg_mda_used_count(pv->vg));
+	}
 
 	return 1;
 }
--- LVM2/tools/vgextend.c	2009/11/01 19:51:55	1.55
+++ LVM2/tools/vgextend.c	2010/07/07 18:59:46	1.56
@@ -63,6 +63,15 @@
 	if (!vg_extend(vg, argc, argv, &pp))
 		goto_bad;
 
+	if (arg_count(cmd, metadataignore_ARG) &&
+	    (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) &&
+	    (vg_mda_copies(vg) != vg_mda_used_count(vg))) {
+		log_warn("WARNING: Changing preferred number of copies of VG %s "
+			 "metadata from %"PRIu32" to %"PRIu32, vg_name,
+			 vg_mda_copies(vg), vg_mda_used_count(vg));
+		vg_set_mda_copies(vg, vg_mda_used_count(vg));
+	}
+
 	/* ret > 0 */
 	log_verbose("Volume group \"%s\" will be extended by %d new "
 		    "physical volumes", vg_name, argc);



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

* LVM2 lib/metadata/metadata.c tools/vgextend.c
@ 2009-07-14  2:14 wysochanski
  0 siblings, 0 replies; 2+ messages in thread
From: wysochanski @ 2009-07-14  2:14 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2009-07-14 02:14:05

Modified files:
	lib/metadata   : metadata.c 
	tools          : vgextend.c 

Log message:
	Remove READ_REQUIRE_RESIZEABLE from vgextend by moving check inside vg_extend.
	
	Move the check for the RESIZEABLE flag inside the vg_extend function.
	When we consolidated the vg locking, reading, and status flag checking,
	we tied the check for the RESIZEABLE flag to the vg_read() call.  The problem
	with this is you cannot know what other APIs the application my or may not
	call after a vg_read() call.  Thus the READ_REQUIRE_RESIZEABLE flag is not
	really ideal - ideally we should be checking for this flag on a specific
	operation, not inside the vg_read() call.  This patch moves one check inside
	the library.
	
	Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
	Acked-by: Alasdair G Kergon <agk@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.246&r2=1.247
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47

--- LVM2/lib/metadata/metadata.c	2009/07/10 21:19:37	1.246
+++ LVM2/lib/metadata/metadata.c	2009/07/14 02:14:04	1.247
@@ -439,6 +439,9 @@
 	struct physical_volume *pv;
 	struct cmd_context *cmd = vg->cmd;
 
+	if (_vg_bad_status_bits(vg, RESIZEABLE_VG))
+		return 0;
+
 	if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
 		log_error("Can't get lock for orphan PVs");
 		return 0;
--- LVM2/tools/vgextend.c	2009/07/10 20:09:21	1.46
+++ LVM2/tools/vgextend.c	2009/07/14 02:14:05	1.47
@@ -37,8 +37,7 @@
 	argv++;
 
 	log_verbose("Checking for volume group \"%s\"", vg_name);
-	vg = vg_read_for_update(cmd, vg_name, NULL,
-				READ_REQUIRE_RESIZEABLE);
+	vg = vg_read_for_update(cmd, vg_name, NULL, 0);
 	if (vg_read_error(vg)) {
 		vg_release(vg);
 		return ECMD_FAILED;



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

end of thread, other threads:[~2010-07-07 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07 18:59 LVM2 lib/metadata/metadata.c tools/vgextend.c wysochanski
  -- strict thread matches above, loose matches on Subject: below --
2009-07-14  2:14 wysochanski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.