From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2334 invoked by alias); 4 Nov 2011 22:45:53 -0000 Received: (qmail 2317 invoked by uid 9737); 4 Nov 2011 22:45:53 -0000 Date: Fri, 04 Nov 2011 22:45:00 -0000 Message-ID: <20111104224553.2315.qmail@sourceware.org> From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/metadata lv_manip.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00017.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2011-11-04 22:45:52 Modified files: lib/metadata : lv_manip.c Log message: Thin pool allocation simplified Support allocation of metadata from the same PV, if the VG is build only from one PV. As thinp is not mirror - we do not require 2 PVs for basic thin usage as user is losing only perfomance. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.322&r2=1.323 --- LVM2/lib/metadata/lv_manip.c 2011/11/04 22:44:22 1.322 +++ LVM2/lib/metadata/lv_manip.c 2011/11/04 22:45:52 1.323 @@ -2568,10 +2568,15 @@ if (segtype_is_virtual(segtype)) return lv_add_virtual_segment(lv, 0u, extents, segtype, thin_pool_name); - if (!lv->le_count && segtype_is_thin_pool(segtype)) + if (!lv->le_count && segtype_is_thin_pool(segtype)) { + if (stripes == 1 && (dm_list_size(allocatable_pvs) == 1)) { + log_warn("WARNING: Only one PV available for thin pool data and metadata."); + alloc = ALLOC_ANYWHERE; + } /* Thin pool allocation treats its metadata device like a mirror log. */ + /* TODO: add support for stripped metadata pool */ log_count = 1; - else if (segtype_is_raid(segtype) && !lv->le_count) + } else if (segtype_is_raid(segtype) && !lv->le_count) log_count = mirrors * stripes; if (!(ah = allocate_extents(lv->vg, lv, segtype, stripes, mirrors,