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 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
Date: Tue, 22 Apr 2008 12:54:00 -0000	[thread overview]
Message-ID: <20080422125433.19007.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-04-22 12:54:33

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : metadata.c lv_manip.c 

Log message:
	Check lv_count in vg_validate.
	Fix internal LV counter when a snapshot is removed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.856&r2=1.857
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.171&r2=1.172
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.153&r2=1.154

--- LVM2/WHATS_NEW	2008/04/22 11:47:22	1.856
+++ LVM2/WHATS_NEW	2008/04/22 12:54:32	1.857
@@ -1,5 +1,7 @@
 Version 2.02.36 - 
 =================================
+  Check lv_count in vg_validate.
+  Fix internal LV counter when a snapshot is removed.
   Fix metadata corruption writing lvm1-formatted metadata with snapshots.
   Add --prefixes to reporting tools for field name prefix output format.
   Fix lvconvert -m0 allocatable space check.
--- LVM2/lib/metadata/metadata.c	2008/04/15 14:46:19	1.171
+++ LVM2/lib/metadata/metadata.c	2008/04/22 12:54:33	1.172
@@ -1177,6 +1177,7 @@
 	struct lv_list *lvl, *lvl2;
 	char uuid[64] __attribute((aligned(8)));
 	int r = 1;
+	uint32_t lv_count;
 
 	/* FIXME Also check there's no data/metadata overlap */
 
@@ -1210,6 +1211,15 @@
 		r = 0;
 	}
 
+	if ((lv_count = (uint32_t) list_size(&vg->lvs)) !=
+	    vg->lv_count + 2 * vg->snapshot_count) {
+		log_error("Internal error: #internal LVs (%u) != #LVs (%"
+			  PRIu32 ") + 2 * #snapshots (%" PRIu32 ") in VG %s",
+			  list_size(&vg->lvs), vg->lv_count,
+			  vg->snapshot_count, vg->name);
+		r = 0;
+	}
+
 	list_iterate_items(lvl, &vg->lvs) {
 		list_iterate_items(lvl2, &vg->lvs) {
 			if (lvl == lvl2)
--- LVM2/lib/metadata/lv_manip.c	2008/04/10 17:09:31	1.153
+++ LVM2/lib/metadata/lv_manip.c	2008/04/22 12:54:33	1.154
@@ -439,7 +439,8 @@
 
 		list_del(&lvl->list);
 
-		lv->vg->lv_count--;
+		if (!(lv->status & SNAPSHOT))
+			lv->vg->lv_count--;
 	} else if (lv->vg->fid->fmt->ops->lv_setup &&
 		   !lv->vg->fid->fmt->ops->lv_setup(lv->vg->fid, lv))
 		return_0;


             reply	other threads:[~2008-04-22 12:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 12:54 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-04 22:49 zkabelac
2011-08-10 20:17 zkabelac
2010-09-23 12:02 prajnoha
2010-07-07  2:53 agk
2010-03-31 17:21 mbroz
2009-03-16 14:35 mbroz
2008-06-23 19:04 wysochanski
2007-07-12 15:38 wysochanski
2007-07-12  5:04 wysochanski
2007-07-11 23:33 wysochanski
2007-06-06 19:40 wysochanski
2007-04-25 20:03 wysochanski
2007-02-07 13:29 agk
2005-04-18 14:56 agk
2004-06-19 19:27 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=20080422125433.19007.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).