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

mirror: Restrict region size to power of 2.

This commit is contained in:
Alasdair G Kergon 2014-12-02 14:24:21 +00:00
parent 9258e57a50
commit de53e0955d
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.115 -
=====================================
Still restrict mirror region size to power of 2 when VG extent size is not.
Version 2.02.114 - 28th November 2014
=====================================

View File

@ -164,7 +164,7 @@ uint32_t adjusted_mirror_region_size(uint32_t extent_size, uint32_t extents,
{
uint64_t region_max;
region_max = (1 << (ffs((int)extents) - 1)) * (uint64_t) extent_size;
region_max = (1 << (ffs((int)extents) - 1)) * (uint64_t) (1 << (ffs((int)extent_size) - 1));
if (region_max < UINT32_MAX && region_size > region_max) {
region_size = (uint32_t) region_max;