From: Heinz Mauelshagen <heinzm@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - lv{resize, extend, reduce}: reject size change on 2-legged raid5*
Date: Wed, 24 Jun 2020 11:56:05 +0000 (GMT) [thread overview]
Message-ID: <20200624115605.D0C303870872@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2cf0f90780bed64cb4062eb6dfa714ed03eecfb7
Commit: 2cf0f90780bed64cb4062eb6dfa714ed03eecfb7
Parent: 3bd9d81b29fb8ba490d87b3557861bf00047855d
Author: Heinz Mauelshagen <heinzm@redhat.com>
AuthorDate: Wed Jun 24 13:52:53 2020 +0200
Committer: Heinz Mauelshagen <heinzm@redhat.com>
CommitterDate: Wed Jun 24 13:52:56 2020 +0200
lv{resize,extend,reduce}: reject size change on 2-legged raid5*
Reject size changing request in to avoid 'Bus error' and
display hint to convert to more stripes.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1784351
---
lib/metadata/lv_manip.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index c1c86aa4c..142435bbb 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5066,6 +5066,7 @@ static int _lvresize_check(struct logical_volume *lv,
struct lvresize_params *lp)
{
struct volume_group *vg = lv->vg;
+ struct lv_segment *seg = first_seg(lv);
if (lv_is_external_origin(lv)) {
/*
@@ -5089,6 +5090,12 @@ static int _lvresize_check(struct logical_volume *lv,
return 0;
}
+ if (seg && seg_is_any_raid5(seg) && seg->area_count < 3) {
+ log_error("Cannot resize %s LV %s. Convert to more stripes first.",
+ lvseg_name(seg), display_lvname(lv));
+ return 0;
+ }
+
if (lv_is_raid(lv) &&
lp->resize == LV_REDUCE) {
unsigned attrs;
reply other threads:[~2020-06-24 11:56 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=20200624115605.D0C303870872@sourceware.org \
--to=heinzm@sourceware.org \
--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.