public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: prajnoha@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/format_text/format-text.c ...
Date: Wed, 09 May 2012 12:31:00 -0000	[thread overview]
Message-ID: <20120509123104.4087.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2012-05-09 12:31:00

Modified files:
	.              : WHATS_NEW 
	lib/format_text: format-text.c 
	test/shell     : pvcreate-operation.sh 

Log message:
	Fix division by zero if PV with zero PE count is used during vgcfgrestore.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2399&r2=1.2400
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.200&r2=1.201
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/pvcreate-operation.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3

--- LVM2/WHATS_NEW	2012/05/09 12:17:06	1.2399
+++ LVM2/WHATS_NEW	2012/05/09 12:30:56	1.2400
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Fix division by zero if PV with zero PE count is used during vgcfgrestore.
   Add initial support for thin pool lvconvert.
   Fix lvrename for thin volumes (regression in for_each_sub_lv() 2.02.89).
   Fix up-convert when mirror activation is controled by volume_list and tags.
--- LVM2/lib/format_text/format-text.c	2012/04/10 12:26:27	1.200
+++ LVM2/lib/format_text/format-text.c	2012/05/09 12:30:59	1.201
@@ -1713,7 +1713,7 @@
 			   pv->pe_start + size_reduction;
 
 	/* Recalculate number of extents that will fit */
-	if (!pv->pe_count) {
+	if (!pv->pe_count && vg->extent_size) {
 		pe_count = (pv->size - pv->pe_start - size_reduction) /
 			   vg->extent_size;
 		if (pe_count > UINT32_MAX) {
--- LVM2/test/shell/pvcreate-operation.sh	2012/03/16 13:00:06	1.2
+++ LVM2/test/shell/pvcreate-operation.sh	2012/05/09 12:30:59	1.3
@@ -111,6 +111,14 @@
 vgcfgbackup -f $backupfile
 not pvcreate --uuid $uuid2 --restorefile $backupfile "$dev2"
 
+# vgcfgrestore of a VG containing a PV with zero PEs (bz #820116)
+# (use case: one PV in a VG used solely to keep metadata)
+size_mb=$(($(blockdev --getsz $dev1) / 2048))
+pvcreate --metadatasize $size_mb $dev1
+vgcreate $vg1 $dev1
+vgcfgbackup -f $backupfile
+vgcfgrestore -f $backupfile $vg1
+
 # pvcreate wipes swap signature when forced
 dd if=/dev/zero of="$dev1" bs=1024 count=64
 mkswap "$dev1"


             reply	other threads:[~2012-05-09 12:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 12:31 prajnoha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-04-21 13:13 zkabelac
2011-02-28 13:19 prajnoha
2011-02-25 14:08 prajnoha
2009-05-07 12:11 mbroz
2007-11-05 17:17 agk
2007-04-25 21:10 wysochanski
2007-03-23 12:43 mbroz
2007-01-09 21:12 agk
2006-10-05 22:02 agk
2006-08-17 19:53 agk
2006-08-17 19:31 agk
2006-04-29 22:08 agk
2005-09-01 18:37 agk
2005-04-06 18:59 agk
2005-01-20 18:11 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=20120509123104.4087.qmail@sourceware.org \
    --to=prajnoha@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).