From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvresize: enable crypt resizing with --force
Date: Fri, 20 Jan 2023 18:06:16 +0000 (GMT) [thread overview]
Message-ID: <20230120180616.4EA603858434@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ed808a9b548ca59221d512bfb7ae581e8367fe50
Commit: ed808a9b548ca59221d512bfb7ae581e8367fe50
Parent: 3bb55765286dc8e4f0000957d85a6b8ee2752852
Author: David Teigland <teigland@redhat.com>
AuthorDate: Fri Jan 20 11:56:40 2023 -0600
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Fri Jan 20 12:04:55 2023 -0600
lvresize: enable crypt resizing with --force
Update previous commit
"lvresize: only resize crypt when fs resize is enabled"
to enable crypt resizing when --force is set and --resizefs
is not set. This is because it's been allowed in the past
and people have used it, but it's not a good idea.
---
lib/metadata/lv_manip.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index cfb118f11..f06b08254 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6417,9 +6417,13 @@ static int _fs_reduce(struct cmd_context *cmd, struct logical_volume *lv,
goto out;
}
if (!strcmp(lp->fsopt, "checksize")) {
- log_error("crypt reduce is required (see --resizefs or cryptsetup resize.)");
- ret = 0;
- goto out;
+ if (!lp->force) {
+ log_error("crypt reduce is required (see --resizefs or cryptsetup resize.)");
+ ret = 0;
+ goto out;
+ }
+ /* This is only because it has been allowed in the past. */
+ log_print("Forcing cryptsetup resize (--resizefs preferred.)");
}
if (test_mode()) {
ret = 1;
reply other threads:[~2023-01-20 18:06 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=20230120180616.4EA603858434@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.