1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2017-07-21 20:58:33 +02:00
parent 3654f478e1
commit 8256170e6a
3 changed files with 13 additions and 6 deletions

View File

@ -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.

View File

@ -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));

View File

@ -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;