diff options
author | Pawel Baldysiak <pawel.baldysiak@intel.com> | 2017-07-26 16:41:54 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-07-27 11:32:32 +0200 |
commit | 795bd44ed11aafbed2628ba21216c667371e79a5 (patch) | |
tree | 1ef9db054cc2f403b06a5cd3a0954f1faf49c91f /super1.c | |
parent | Monitor: don't assume mdadm parameter is a block device (diff) | |
download | mdadm-795bd44ed11aafbed2628ba21216c667371e79a5.tar.xz mdadm-795bd44ed11aafbed2628ba21216c667371e79a5.zip |
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>
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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) |