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

mirror: fix 32bit size calculation

On 32bit arch  size_t remains 4-byte wide - so size can't
get correct result for multiplication of 32bit numbers.
This commit is contained in:
Zdenek Kabelac 2018-04-19 12:29:42 +02:00
parent ff3ffe30e4
commit 73189170f5
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.178 -
=====================================
Fix incorrect mirror log size calculation on 32bit arch.
Enhnace preloading tree creating.
Fix regression on acceptance of any LV on lvconvert.
Restore usability of thin LV to be again external origin for another thin.

View File

@ -1667,9 +1667,9 @@ struct alloc_handle {
#define BYTE_SHIFT 3
static uint32_t _mirror_log_extents(uint32_t region_size, uint32_t pe_size, uint32_t area_len)
{
size_t area_size, bitset_size, log_size, region_count;
uint64_t area_size, region_count, bitset_size, log_size;
area_size = (size_t)area_len * pe_size;
area_size = (uint64_t) area_len * pe_size;
region_count = dm_div_up(area_size, region_size);
/* Work out how many "unsigned long"s we need to hold the bitset. */