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/activate/activate.c lib/c ...
Date: 5 Jun 2008 13:06:40 -0000	[thread overview]
Message-ID: <20080605130640.17912.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk at sourceware.org	2008-06-05 13:06:39

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c 
	lib/cache      : lvmcache.c 

Log message:
	When activating, if precommitted metadata is still cached, assume it's live.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.881&r2=1.882
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.135&r2=1.136
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53

--- LVM2/WHATS_NEW	2008/06/05 12:45:53	1.881
+++ LVM2/WHATS_NEW	2008/06/05 13:06:39	1.882
@@ -9,6 +9,7 @@
 
 Version 2.02.37 - 
 =================================
+  When activating, if precommitted metadata is still cached, assume it's live.
   When removing LV symlinks, skip any where the VG name is not determined.
   Drop metadata cache if update fails in vg_revert or vg_commit.
   Avoid spurious duplicate VG messages referring to VGs that are gone.
--- LVM2/lib/activate/activate.c	2008/04/10 21:34:18	1.135
+++ LVM2/lib/activate/activate.c	2008/06/05 13:06:39	1.136
@@ -993,7 +993,11 @@
 	if (!activation())
 		goto activate;
 
-	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
+	/*
+	 * If we're activating and precommitted metadata is still cached,
+	 * we assume it matches the new live metadata.
+	 */
+	if (!(lv = lv_from_lvid(cmd, lvid_s, 1)))
 		return 0;
 
 	if (!_passes_activation_filter(cmd, lv)) {
@@ -1018,7 +1022,11 @@
 	if (!activation())
 		return 1;
 
-	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
+	/*
+	 * If we're activating and precommitted metadata is still cached,
+	 * we assume it matches the new live metadata.
+	 */
+	if (!(lv = lv_from_lvid(cmd, lvid_s, 1)))
 		return 0;
 
 	if (filter && !_passes_activation_filter(cmd, lv)) {
--- LVM2/lib/cache/lvmcache.c	2008/05/28 22:27:47	1.52
+++ LVM2/lib/cache/lvmcache.c	2008/06/05 13:06:39	1.53
@@ -479,8 +479,20 @@
 	if (!_vginfo_is_valid(vginfo))
 		return NULL;
 
+	/*
+	 * Don't return cached data if either:
+	 * (i)  precommitted metadata is requested but we don't have it cached
+	 *      - caller should read it off disk;
+	 * (ii) live metadata is requested but we have precommitted metadata cached
+	 *      and no devices are suspended so caller may read it off disk.
+	 *
+	 * If live metadata is requested but we have precommitted metadata cached
+	 * and devices are suspended, we assume this precommitted metadata has
+	 * already been preloaded and committed so it's OK to return it as live.
+	 * Note that we do not clear the PRECOMMITTED flag.
+	 */
 	if ((precommitted && !vginfo->precommitted) ||
-	    (!precommitted && vginfo->precommitted))
+	    (!precommitted && vginfo->precommitted && !memlock()))
 		return NULL;
 
 	if (!(fid =  vginfo->fmt->ops->create_instance(vginfo->fmt,



             reply	other threads:[~2008-06-05 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 13:06 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-28 17:33 LVM2 ./WHATS_NEW lib/activate/activate.c lib/c 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=20080605130640.17912.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.