All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [PATCH LVM2] set stripes = 0 for the log device only allocation
Date: Tue, 12 Dec 2006 17:54:23 -0500	[thread overview]
Message-ID: <457F331F.2020906@ce.jp.nec.com> (raw)

Hi,

This patch fixes the allocation failure at adding mirror log
if there is only one PV available.


In lib/metadata/lv_manip.c:_allocate(), the number of stripes
is used for calculation of the number of necessary PVs.
    if (areas_size < ah->area_count + ah->log_count) {

On the other hand, lvconvert gives stripes = 1 even if the
allocation request is for log device only.

As a result, the check above will fail if there is only one
PV available and the command will fail as followings:
  Not enough PVs with free space available for parallel allocation.

even though the log device should be allocated from the free PV
without problem.

For log-only allocation, don't give stripes = 1 to the allocator.
The stripes value is considered to be the number of stripes
for which the allocation is requested. (i.e. ah->area_count)


Patch applicable to LVM2 2.02.16.
The patch depends on safe-area_multiple.patch for correct handling
of stripes = 0 by the allocator.

Shell script to reproduce the problem and the sample metadata
is attached for reference.
You can reproduce the problem with just executing the script
without additional parameters.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set-stripes-0-for-log-alloc.patch
Type: text/x-patch
Size: 1330 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20061212/6f090191/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-logalloc-from-only-one-free-PV.sh
Type: application/x-sh
Size: 2304 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20061212/6f090191/attachment.sh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lvm2-logalloc-from-only-one-free-PV.vg
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20061212/6f090191/attachment.ksh>

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

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=457F331F.2020906@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --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.