super1: Always round data offset to 1M

Currently if metadata requires more then 1M,
data offset will be rounded down to closest MB.
This is not correct, since less then required space is reserved.
Always round data offset up to multiple of 1M.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Pawel Baldysiak 2017-07-26 16:41:54 +02:00 committed by Jes Sorensen
parent cb91230c87
commit 795bd44ed1
1 changed files with 1 additions and 2 deletions

View File

@ -2796,8 +2796,7 @@ static int validate_geometry1(struct supertype *st, int level,
headroom >>= 1;
data_offset = 12*2 + bmspace + headroom;
#define ONE_MEG (2*1024)
if (data_offset > ONE_MEG)
data_offset = (data_offset / ONE_MEG) * ONE_MEG;
data_offset = ROUND_UP(data_offset, ONE_MEG);
break;
}
if (st->data_offset == INVALID_SECTORS)