1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

lvcreate: do not round cache volumes on cache chunks

Since cache chunk might be huge and there is no technical need
to enforce rounding and there is actually more 'real' VG space
used then necessary - keep rounding on 'chunk' bounrary only
for thin volumes - where it's the space used anyway.

NB: we support conversion of any-size 'existing' LV into cached LV.
This commit is contained in:
Zdenek Kabelac 2017-03-09 17:15:56 +01:00
parent f24a1f06b2
commit 298d12c459
2 changed files with 14 additions and 14 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.169 - Version 2.02.169 -
===================================== =====================================
Skip rounding on cache chunk size boudary when create cache LV.
Improve cache_set_params support for chunk_size selection. Improve cache_set_params support for chunk_size selection.
Fix metadata profile allocation/cache_[mode|policy] setting. Fix metadata profile allocation/cache_[mode|policy] setting.
Fix missing support for using allocation/cache_pool_chunk_size setting. Fix missing support for using allocation/cache_pool_chunk_size setting.

View File

@ -7402,21 +7402,20 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
return NULL; return NULL;
} }
/* Validate volume size to to aling on chunk for small extents */
/* Cache chunk size is always set */
size = first_seg(pool_lv)->chunk_size;
if (size > vg->extent_size) {
/* Align extents on chunk boundary size */
size = ((uint64_t)vg->extent_size * lp->extents + size - 1) /
size * size / vg->extent_size;
if (size != lp->extents) {
log_print_unless_silent("Rounding size (%d extents) up to chunk boundary "
"size (%d extents).", lp->extents, size);
lp->extents = size;
}
}
if (seg_is_thin_volume(lp)) { if (seg_is_thin_volume(lp)) {
/* Validate volume size to to aling on chunk for small extents */
size = first_seg(pool_lv)->chunk_size;
if (size > vg->extent_size) {
/* Align extents on chunk boundary size */
size = ((uint64_t)vg->extent_size * lp->extents + size - 1) /
size * size / vg->extent_size;
if (size != lp->extents) {
log_print_unless_silent("Rounding size (%d extents) up to chunk boundary "
"size (%d extents).", lp->extents, size);
lp->extents = size;
}
}
thin_pool_was_active = lv_is_active(pool_lv); thin_pool_was_active = lv_is_active(pool_lv);
if (lv_is_new_thin_pool(pool_lv)) { if (lv_is_new_thin_pool(pool_lv)) {
if (!check_new_thin_pool(pool_lv)) if (!check_new_thin_pool(pool_lv))