diff options
author | David Teigland <teigland@redhat.com> | 2020-07-07 13:20:18 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-07-07 13:20:18 -0500 |
commit | 40266faaab07f5578d137f9e400fbc9190edabcd (patch) | |
tree | cd5d008c9130e840603eecd094d01b8ed700a112 | |
parent | ad773511c59aea239592c014a2dab4161ed92214 (diff) | |
download | lvm2-40266faaab07f5578d137f9e400fbc9190edabcd.tar.gz |
writecache: skip fs block size check in test mode
if doing so requires activating the LV
-rw-r--r-- | tools/lvconvert.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 0155fdbf9..61256c698 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5649,6 +5649,11 @@ static int _set_writecache_block_size(struct cmd_context *cmd, stack; if (!(fs_dev = dev_cache_get(cmd, pathname, NULL))) { + if (test_mode()) { + log_print("Test mode skips checking fs block size."); + fs_block_size = 0; + goto skip_fs; + } log_error("Device for LV not found to check block size %s", pathname); goto_bad; } @@ -5667,6 +5672,7 @@ static int _set_writecache_block_size(struct cmd_context *cmd, * With 512 LBS and 4K PBS, mkfs.xfs will use xfs sector size 4K. */ rv = get_fs_block_size(fs_dev, &fs_block_size); +skip_fs: if (!rv || !fs_block_size) { if (lbs_4k && pbs_4k && !pbs_512) { block_size = 4096; |