From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - integrity: skip calling add when removing images
Date: Fri, 29 May 2020 18:21:41 +0000 (GMT) [thread overview]
Message-ID: <20200529182141.C0834386F477@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ae029fcced5f79af748df28f20f952d158804482
Commit: ae029fcced5f79af748df28f20f952d158804482
Parent: 7b04ed07ba2e68f527ebb4f8d2b2bd092692f2d2
Author: David Teigland <teigland@redhat.com>
AuthorDate: Fri May 29 13:18:24 2020 -0500
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Fri May 29 13:18:24 2020 -0500
integrity: skip calling add when removing images
When lvconvert is used to remove raid images, we can
skip calling lv_add_integrity_to_raid(), which finds
nothing to do, but the the blocksize validation would
be called unnecessarily and trigger spurious errors.
---
tools/lvconvert.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8652252d3..76e00f0a2 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1319,6 +1319,7 @@ static int _raid4_conversion_supported(struct logical_volume *lv, struct lvconve
static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp)
{
int image_count = 0;
+ int images_reduced = 0;
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *seg = first_seg(lv);
@@ -1357,6 +1358,8 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
else
image_count = lp->mirrors + 1;
+ images_reduced = (image_count < lv_raid_image_count(lv));
+
if (image_count < 1) {
log_error("Unable to %s images by specified amount.",
lp->keep_mimages ? "split" : "reduce");
@@ -1400,7 +1403,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
lp->region_size : seg->region_size , lp->pvh))
return_0;
- if (lv_raid_has_integrity(lv)) {
+ if (lv_raid_has_integrity(lv) && !images_reduced) {
struct integrity_settings *isettings = NULL;
if (!lv_get_raid_integrity_settings(lv, &isettings))
return_0;
reply other threads:[~2020-05-29 18:21 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=20200529182141.C0834386F477@sourceware.org \
--to=teigland@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.