All of lore.kernel.org
 help / color / mirror / Atom feed
From: agk@sourceware.org <agk@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/lock ...
Date: 19 May 2010 02:08:52 -0000	[thread overview]
Message-ID: <20100519020852.9836.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk at sourceware.org	2010-05-19 02:08:51

Modified files:
	.              : WHATS_NEW 
	lib/cache      : lvmcache.c 
	lib/locking    : locking.c 
	lib/metadata   : metadata-exported.h metadata.c 

Log message:
	Validate orphan and VG_GLOBAL lock order too.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1564&r2=1.1565
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.88&r2=1.89
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.144&r2=1.145
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.340&r2=1.341

--- LVM2/WHATS_NEW	2010/05/19 01:16:40	1.1564
+++ LVM2/WHATS_NEW	2010/05/19 02:08:50	1.1565
@@ -1,5 +1,6 @@
 Version 2.02.66 - 
 ===============================
+  Validate orphan and VG_GLOBAL lock order too.
   Accept orphan VG names as parameters to lock_vol() and related functions.
   Use is_orphan_vg in place of hard-coded prefix tests.
 
--- LVM2/lib/cache/lvmcache.c	2010/05/19 01:16:40	1.88
+++ LVM2/lib/cache/lvmcache.c	2010/05/19 02:08:50	1.89
@@ -224,11 +224,21 @@
 
 /*
  * Ensure vgname2 comes after vgname1 alphabetically.
- * Orphans don't count.
+ * Orphan locks come last.
+ * VG_GLOBAL comes first.
  */
 static int _vgname_order_correct(const char *vgname1, const char *vgname2)
 {
-	if (is_orphan_vg(vgname1) || is_orphan_vg(vgname2))
+	if (is_global_vg(vgname1))
+		return 1;
+
+	if (is_global_vg(vgname2))
+		return 0;
+
+	if (is_orphan_vg(vgname1))
+		return 0;
+
+	if (is_orphan_vg(vgname2))
 		return 1;
 
 	if (strcmp(vgname1, vgname2) < 0)
--- LVM2/lib/locking/locking.c	2010/05/19 01:16:41	1.82
+++ LVM2/lib/locking/locking.c	2010/05/19 02:08:51	1.83
@@ -424,7 +424,7 @@
 		if (is_orphan_vg(vol))
 			vol = VG_ORPHANS;
 		/* VG locks alphabetical, ORPHAN lock last */
-		else if (((flags & LCK_TYPE_MASK) != LCK_UNLOCK) &&
+		if (((flags & LCK_TYPE_MASK) != LCK_UNLOCK) &&
 			 !(flags & LCK_CACHE) &&
 			 !lvmcache_verify_lock_order(vol))
 			return 0;
--- LVM2/lib/metadata/metadata-exported.h	2010/05/14 15:19:43	1.144
+++ LVM2/lib/metadata/metadata-exported.h	2010/05/19 02:08:51	1.145
@@ -423,6 +423,7 @@
 int move_pvs_used_by_lv(struct volume_group *vg_from,
 			struct volume_group *vg_to,
 			const char *lv_name);
+int is_global_vg(const char *vg_name);
 int is_orphan_vg(const char *vg_name);
 int is_orphan(const struct physical_volume *pv);
 int is_missing_pv(const struct physical_volume *pv);
--- LVM2/lib/metadata/metadata.c	2010/05/19 01:16:41	1.340
+++ LVM2/lib/metadata/metadata.c	2010/05/19 02:08:51	1.341
@@ -3326,6 +3326,11 @@
 	return 1;
 }
 
+int is_global_vg(const char *vg_name)
+{
+	return (vg_name && !strcmp(vg_name, VG_GLOBAL)) ? 1 : 0;
+}
+
 /**
  * is_orphan_vg - Determine whether a vg_name is an orphan
  * @vg_name: pointer to the vg_name



             reply	other threads:[~2010-05-19  2:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19  2:08 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-05-19  1:16 LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/lock agk
2010-05-19  0:52 agk
2008-04-03 18:56 agk

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=20100519020852.9836.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /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 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.