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

fix bad result from _cache_min_metadata_size

fixes regression from switching to use _cache_min_metadata_size
(commit c08704cee7) which returns
a bogus value when the cachevol size is 8MB.
This commit is contained in:
David Teigland 2020-04-10 16:57:12 -05:00
parent 48c1a295a2
commit 712c9efbf6

View File

@ -1094,6 +1094,10 @@ int cache_vol_set_params(struct cmd_context *cmd,
if (!meta_size) {
meta_size = _cache_min_metadata_size(pool_lv->size, chunk_size);
/* fix bad value from _cache_min_metadata_size */
if (meta_size > (pool_lv->size / 2))
meta_size = pool_lv->size / 2;
if (meta_size < min_meta_size)
meta_size = min_meta_size;