summaryrefslogtreecommitdiff
path: root/tools/lvconvert.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-01-12 14:41:38 -0600
committerDavid Teigland <teigland@redhat.com>2021-02-02 13:52:31 -0600
commit8454ce66c511438ef0d9da3d3b0bac2a5a3d8f2b (patch)
treef7a430543a44e1e0ea8ccd0507588016a8701698 /tools/lvconvert.c
parentbee9f4efdd8195f383f026290b741314cdc42439 (diff)
downloadlvm2-8454ce66c511438ef0d9da3d3b0bac2a5a3d8f2b.tar.gz
writecache: let block_size setting override device block sizes
In cases where lvconvert does not detect a fs block size on the device, it falls back to choosing a writecache block size based on the device's LBS and PBS (tries to match those.) If the user specifies a writecache block size on the command line (--cachesettings block_size=4096|512), lvconvert currently fails and reports an error if the user-specified value does not match the value lvconvert would have chosen based on LBS and PBS. The purpose of allowing a user-specified value on the command line is to override what lvconvert would otherwise do, so change this to just print a warning that the user value does not match the value that would be chosen based on the LBS/PBS, and then take the user-specified value as the writecache block size.
Diffstat (limited to 'tools/lvconvert.c')
-rw-r--r--tools/lvconvert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index e37172a5e..3457cd08a 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -6015,9 +6015,9 @@ skip_fs:
}
if (block_size_setting && (block_size_setting != block_size)) {
- log_error("Cannot use writecache block size %u with unknown file system block size, logical block size %u, physical block size %u.",
- block_size_setting, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
- goto bad;
+ log_warn("WARNING: writecache block size %u does not match device block sizes, logical %u physical %u",
+ block_size_setting, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
+ block_size = block_size_setting;
}
if (block_size != 512) {