public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/tools vgextend.c
@ 2010-10-18 17:27 mornfall
  0 siblings, 0 replies; 2+ messages in thread
From: mornfall @ 2010-10-18 17:27 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-10-18 17:27:10

Modified files:
	tools          : vgextend.c 

Log message:
	Avoid an extraneous orphans unlock in vgextend --restoremissing.

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

--- LVM2/tools/vgextend.c	2010/10/13 10:34:32	1.60
+++ LVM2/tools/vgextend.c	2010/10/18 17:27:10	1.61
@@ -133,7 +133,8 @@
 	r = ECMD_PROCESSED;
 
 bad:
-	unlock_vg(cmd, VG_ORPHANS);
+	if (!arg_count(cmd, restoremissing_ARG))
+		unlock_vg(cmd, VG_ORPHANS);
 	unlock_and_release_vg(cmd, vg, vg_name);
 	return r;
 }


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

* LVM2/tools vgextend.c
@ 2009-08-13 12:03 wysochanski
  0 siblings, 0 replies; 2+ messages in thread
From: wysochanski @ 2009-08-13 12:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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;


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

end of thread, other threads:[~2010-10-18 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-18 17:27 LVM2/tools vgextend.c mornfall
  -- strict thread matches above, loose matches on Subject: below --
2009-08-13 12:03 wysochanski

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