public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/lib cache/lvmcache.c metadata/metadata.c
Date: Fri, 06 Jun 2008 11:12:00 -0000	[thread overview]
Message-ID: <20080606111251.15696.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-06-06 11:12:50

Modified files:
	lib/cache      : lvmcache.c 
	lib/metadata   : metadata.c 

Log message:
	cope with volatile vginfo in vg_read

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.177&r2=1.178

--- LVM2/lib/cache/lvmcache.c	2008/06/05 14:24:28	1.54
+++ LVM2/lib/cache/lvmcache.c	2008/06/06 11:12:50	1.55
@@ -243,6 +243,9 @@
 {
 	struct lvmcache_vginfo *vginfo;
 
+	if (!vgname)
+		return vginfo_from_vgid(vgid);
+
 	if (!_vgname_hash)
 		return NULL;
 
--- LVM2/lib/metadata/metadata.c	2008/06/06 09:48:04	1.177
+++ LVM2/lib/metadata/metadata.c	2008/06/06 11:12:50	1.178
@@ -1476,6 +1476,8 @@
  * and call vg_read again).
  *
  * If precommitted is set, use precommitted metadata if present.
+ *
+ * Either of vgname or vgid may be NULL.
  */
 static struct volume_group *_vg_read(struct cmd_context *cmd,
 				     const char *vgname,
@@ -1522,6 +1524,10 @@
 		}
 	}
 
+	/* Now determine the correct vgname if none was supplied */
+	if (!vgname && !(vgname = vgname_from_vgid(cmd->mem, vgid)))
+		return_NULL;
+
 	if (use_precommitted && !(fmt->features & FMT_PRECOMMIT))
 		use_precommitted = 0;
 
@@ -1752,7 +1758,7 @@
 	/* Is corresponding vgname already cached? */
 	if ((vginfo = vginfo_from_vgid(vgid)) &&
 	    vginfo->vgname && !is_orphan_vg(vginfo->vgname)) {
-		if ((vg = _vg_read(cmd, vginfo->vgname, vgid,
+		if ((vg = _vg_read(cmd, NULL, vgid,
 				   &consistent, precommitted)) &&
 		    !strncmp((char *)vg->id.uuid, vgid, ID_LEN)) {
 			if (!consistent) {


             reply	other threads:[~2008-06-06 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 11:12 agk [this message]
2010-06-28 20:34 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=20080606111251.15696.qmail@sourceware.org \
    --to=agk@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).