summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2020-01-30 12:43:53 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2020-02-04 17:22:06 +0100
commitd6ac039b65a371caeabb1bf2a191e609ed2cd9f8 (patch)
treebf9e39aa9eddc069ef99fab554f2aa9a9e095aaa
parentde43527f94c172223d25f849411f435ad359ce77 (diff)
downloadlvm2-d6ac039b65a371caeabb1bf2a191e609ed2cd9f8.tar.gz
cov: widen before calculating min_chunk_size
Although we expect min_chunk_size to be 32bit value, for large size of caches it might be useful to do calcs 64bit. So to avoid doing shift as signed 32bit - use unsigned 64bit from the start.
-rw-r--r--lib/metadata/cache_manip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index 5613a2224..49b385052 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -222,7 +222,7 @@ int update_cache_pool_params(struct cmd_context *cmd,
*chunk_size = get_default_allocation_cache_pool_chunk_size_CFG(cmd,
profile);
/* Use power-of-2 for min chunk size when unspecified */
- min_chunk_size = 1 << (32 - clz(min_chunk_size - 1));
+ min_chunk_size = UINT64_C(1) << (32 - clz(min_chunk_size - 1));
}
if (*chunk_size < min_chunk_size) {
/*