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/tools vgextend.c
Date: Thu, 13 Aug 2009 12:03:00 -0000	[thread overview]
Message-ID: <20090813120347.6299.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2009-08-13 12:03:47

Modified files:
	tools          : vgextend.c 

Log message:
	Fix vgextend error path - if ORPHAN lock fails, unlock and release vg.
	
	Full changes
	- Fix vgextend error path when lock_vol(VG_ORPHANS) fails
	- Move lock_vol(VG_ORPHANS) before archive(vg) - safe & simpler error paths
	- Remove legacy comment/code that no longer applies
	
	Found in review - Milan Broz <mbroz@redhat.com>
	Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49

--- LVM2/tools/vgextend.c	2009/07/24 15:01:44	1.48
+++ LVM2/tools/vgextend.c	2009/08/13 12:03:46	1.49
@@ -43,21 +43,15 @@
 		return ECMD_FAILED;
 	}
 
-/********** FIXME
-	log_print("maximum logical volume size is %s",
-		  (dummy = lvm_show_size(LVM_LV_SIZE_MAX(vg) / 2, LONG)));
-	dm_free(dummy);
-	dummy = NULL;
-**********/
-
-	if (!archive(vg))
-		goto error;
-
 	if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
 		log_error("Can't get lock for orphan PVs");
+		unlock_and_release_vg(cmd, vg, vg_name);
 		return ECMD_FAILED;
 	}
 
+	if (!archive(vg))
+		goto error;
+
 	/* extend vg */
 	if (!vg_extend(vg, argc, argv))
 		goto error;


             reply	other threads:[~2009-08-13 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13 12:03 wysochanski [this message]
2010-10-18 17:27 mornfall

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