From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Propagate inability to allocate extents for log on provided area.
Date: Wed, 27 May 2009 13:08:46 +0200 [thread overview]
Message-ID: <4A1D1F3E.5030809@redhat.com> (raw)
Propagate inability to allocate extents for log on provided area.
Easily reproducible with (bug 502761)
vgcreate -s 1k ..
lvcreate -m1 ... <leg1_dev> <leg2_dev> <log_dev>:0-0
Here it needs 2 extents for log but only one is provided.
Currently code fails on assert inside consume_pv_area, now
it should print proper error message.
"Insufficient extents for log allocation for logical volume"
(Patch is more workaround than real fix, the allocation code is not too
user friendly regarding error reporting but it waits for some rewrite:-)
Signed-off-by: Milan Broz <mbroz@redhat.com>
---
lib/metadata/lv_manip.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index eeb4710..7a58a80 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -766,7 +766,14 @@ static int _alloc_parallel_area(struct alloc_handle *ah, uint32_t needed,
ah->log_area.len = mirror_log_extents(ah->log_region_size,
pv_pe_size(log_area->map->pv),
area_len);
- consume_pv_area(log_area, ah->log_area.len);
+ /*
+ * Provided log area is too small,
+ * set zero length to notify layer above
+ */
+ if (ah->log_area.len > log_area->count)
+ ah->log_area.len = 0;
+ else
+ consume_pv_area(log_area, ah->log_area.len);
}
*ix += area_len * ah->area_multiple;
reply other threads:[~2009-05-27 11:08 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=4A1D1F3E.5030809@redhat.com \
--to=mbroz@redhat.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.