diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2017-07-21 20:58:33 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2017-08-01 11:52:27 +0200 |
commit | 8256170e6a2dbed15b790e75f5d1026e3de69a16 (patch) | |
tree | 4c8f714a2204b3371258166824b9535f35f55a07 | |
parent | 3654f478e1beab950f9ee91bc2fd759d22552e1c (diff) | |
download | lvm2-8256170e6a2dbed15b790e75f5d1026e3de69a16.tar.gz |
thin: warn about too big chunks size
lvm2 warned about zeroing and too big chunksize (>=512KiB), but
only during lvconvert, so lvcreate was creating thin-pools
without any warning about possible slowness of thin provisioning
because of zeroing.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/metadata/thin_manip.c | 13 | ||||
-rw-r--r-- | tools/lvconvert.c | 5 |
3 files changed, 13 insertions, 6 deletions
@@ -1,5 +1,6 @@ Version 2.02.174 - ================================= + Add warning when creating thin-pool with zeroing and chunk size >= 512KiB. Introduce exit code 4 EINIT_FAILED to replace -1 when initialisation fails. Add synchronization points with udev during reshape of raid LVs. diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 88dc51a60..bd2d2c3b7 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -752,8 +752,19 @@ int update_thin_pool_params(struct cmd_context *cmd, !set_pool_discards(discards, DEFAULT_THIN_POOL_DISCARDS)) return_0; - if (*zero_new_blocks == THIN_ZERO_UNSELECTED) + if (*zero_new_blocks == THIN_ZERO_UNSELECTED) { *zero_new_blocks = (DEFAULT_THIN_POOL_ZERO) ? THIN_ZERO_YES : THIN_ZERO_NO; + log_verbose("%s pool zeroing on default.", (*zero_new_blocks == THIN_ZERO_YES) ? + "Enabling" : "Disabling"); + } + + if ((*zero_new_blocks == THIN_ZERO_YES) && + (*chunk_size >= DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE * 2)) { + log_warn("WARNING: Pool zeroing and %s large chunk size slows down thin provisioning.", + display_size(cmd, *chunk_size)); + log_warn("WARNING: Consider disabling zeroing (-Zn) or using smaller chunk size (<%s).", + display_size(cmd, DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE * 2)); + } log_verbose("Preferred pool metadata size %s.", display_size(cmd, (uint64_t)*pool_metadata_extents * extent_size)); diff --git a/tools/lvconvert.c b/tools/lvconvert.c index d90e67524..94dee9d32 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -3088,11 +3088,6 @@ static int _lvconvert_to_pool(struct cmd_context *cmd, if (!vg_write(vg) || !vg_commit(vg)) goto_bad; - if ((seg->zero_new_blocks == THIN_ZERO_YES) && - seg->chunk_size >= DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE * 2) - log_warn("WARNING: Pool zeroing and large %s chunk size slows down provisioning.", - display_size(cmd, seg->chunk_size)); - if (activate_pool && !lockd_lv(cmd, pool_lv, "ex", LDLV_PERSISTENT)) { log_error("Failed to lock pool LV %s.", display_lvname(pool_lv)); goto out; |