From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvconvert: read-only origin cannot be merged
Date: Wed, 10 Feb 2021 14:43:55 +0000 (GMT) [thread overview]
Message-ID: <20210210144355.DD0853857C7B@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f90082ce8f218781ff3b9361e748dbff0ff0e2e3
Commit: f90082ce8f218781ff3b9361e748dbff0ff0e2e3
Parent: 289518005834b5844f88ce1f22265df99f7072d0
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Wed Feb 10 00:40:21 2021 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Feb 10 15:39:03 2021 +0100
lvconvert: read-only origin cannot be merged
When user sets snapshost origin as read-only,
lvm will not allow simple merge and user needs to
flip permission,
---
tools/lvconvert.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index a72126bf4..77afaf487 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2162,15 +2162,21 @@ static int _lvconvert_merge_old_snapshot(struct cmd_context *cmd,
log_error("Cannot merge snapshot %s into the origin %s "
"with merging snapshot %s.",
display_lvname(lv), display_lvname(origin),
- display_lvname(find_snapshot(origin)->lv));
+ display_lvname(snap_seg->lv));
return 0;
}
- if (lv_is_external_origin(origin_from_cow(lv))) {
+ if (lv_is_external_origin(origin)) {
log_error("Cannot merge snapshot %s into "
"the read-only external origin %s.",
- display_lvname(lv),
- display_lvname(origin_from_cow(lv)));
+ display_lvname(lv), display_lvname(origin));
+ return 0;
+ }
+
+ if (!(origin->status & LVM_WRITE)) {
+ log_error("Cannot merge snapshot %s into "
+ "the read-only origin %s. (Use lvchange -p rw).",
+ display_lvname(lv), display_lvname(origin));
return 0;
}
reply other threads:[~2021-02-10 14:43 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=20210210144355.DD0853857C7B@sourceware.org \
--to=zkabelac@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.