diff options
author | David Teigland <teigland@redhat.com> | 2023-01-20 11:56:40 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2023-01-20 12:04:55 -0600 |
commit | ed808a9b548ca59221d512bfb7ae581e8367fe50 (patch) | |
tree | 02ea93afec45656021f929b158ca938ae9242315 | |
parent | 3bb55765286dc8e4f0000957d85a6b8ee2752852 (diff) | |
download | lvm2-ed808a9b548ca59221d512bfb7ae581e8367fe50.tar.gz |
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.
-rw-r--r-- | lib/metadata/lv_manip.c | 10 |
1 files 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; |