public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: mbroz@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/format1/format1.c test/t- ...
Date: Mon, 04 Oct 2010 18:59:00 -0000	[thread overview]
Message-ID: <20101004185904.9403.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-10-04 18:59:02

Modified files:
	.              : WHATS_NEW 
	lib/format1    : format1.c 
	test           : t-vgcfgbackup-usage.sh 

Log message:
	Restrict lvm1 partial mode.
	
	Current lvm1 allocation code seems to not properly
	map segments on missing PVs.
	
	For now disable this functionality.
	(It never worked and previous commit just introduced segfault here.)
	
	So the partial mode in lvm1 can only process missing PVs
	with no LV segments only.
	
	Also do not use random PV UUID for missing part but use fixed
	string derived from VG UUID (to not confuse clvmd tests).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1744&r2=1.1745
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgcfgbackup-usage.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6

--- LVM2/WHATS_NEW	2010/09/30 21:06:50	1.1744
+++ LVM2/WHATS_NEW	2010/10/04 18:59:01	1.1745
@@ -1,5 +1,6 @@
 Version 2.02.75 - 
 =====================================
+  Avoid segfault by limiting partial mode for lvm1 metadata. (2.02.74)
   Add dm_zalloc and use it and dm_pool_zalloc throughout.
   Add pv_get_property and create generic internal _get_property function.
   Add 'get' functions for pv and vg properties/fields.
--- LVM2/lib/format1/format1.c	2010/09/30 21:06:51	1.123
+++ LVM2/lib/format1/format1.c	2010/10/04 18:59:02	1.124
@@ -118,6 +118,28 @@
 	struct disk_list *dl;
 	struct dm_list *pvh;
 	struct pv_list *pvl;
+	struct lv_list *ll;
+	struct lv_segment *seg;
+
+	/*
+	 * FIXME: code should remap missing segments to error segment.
+	 * Also current mapping code allocates 1 segment per missing extent.
+	 * For now bail out completely - allocated structures are not complete
+	 */
+	dm_list_iterate_items(ll, &vg->lvs)
+		dm_list_iterate_items(seg, &ll->lv->segments) {
+
+			/* area_count is always 1 here, s == 0 */
+			if (seg_type(seg, 0) != AREA_PV)
+				continue;
+
+			if (seg_pv(seg, 0))
+				continue;
+
+			log_error("Partial mode support for missing lvm1 PVs and "
+				  "partially available LVs is currently not implemented.");
+			return 0;
+	}
 
 	dm_list_iterate(pvh, pvs) {
 		dl = dm_list_item(pvh, struct disk_list);
@@ -129,8 +151,10 @@
 	    !(pvl->pv = dm_pool_zalloc(vg->vgmem, sizeof(*pvl->pv))))
 		return_0;
 
-	if (!id_create(&pvl->pv->id))
-		goto_out;
+	/* Use vg uuid with replaced first chars to "missing" as missing PV UUID */
+	memcpy(&pvl->pv->id.uuid, vg->id.uuid, sizeof(pvl->pv->id.uuid));
+	memcpy(&pvl->pv->id.uuid, "missing", 7);
+
 	if (!(pvl->pv->vg_name = dm_pool_strdup(vg->vgmem, vg->name)))
 		goto_out;
 	memcpy(&pvl->pv->vgid, &vg->id, sizeof(vg->id));
--- LVM2/test/t-vgcfgbackup-usage.sh	2010/09/22 13:45:23	1.5
+++ LVM2/test/t-vgcfgbackup-usage.sh	2010/10/04 18:59:02	1.6
@@ -43,6 +43,9 @@
 vgremove -ff $vg
 
 # vgcfgbackup correctly stores metadata LVM1 with missing PVs
+# FIXME: clvmd seems to have problem with metadata format change here
+# fix it and remove this vgscan
+vgscan
 pvcreate -M1 $devs
 vgcreate -M1 -c n $vg $devs
 lvcreate -l1 -n $lv1 $vg $dev1


             reply	other threads:[~2010-10-04 18:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 18:59 mbroz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-09-22 13:45 mbroz

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=20101004185904.9403.qmail@sourceware.org \
    --to=mbroz@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).