public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: wysochanski@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 lib/metadata/metadata.c tools/vgextend.c
Date: Tue, 14 Jul 2009 02:14:00 -0000	[thread overview]
Message-ID: <20090714021406.1906.qmail@sourceware.org> (raw)

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


             reply	other threads:[~2009-07-14  2:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14  2:14 wysochanski [this message]
2010-07-07 18:59 wysochanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090714021406.1906.qmail@sourceware.org \
    --to=wysochanski@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).