* [PATCH 1/1] super1: Always round data offset to 1M
@ 2017-07-26 14:41 Pawel Baldysiak
2017-07-27 9:32 ` Jes Sorensen
0 siblings, 1 reply; 2+ messages in thread
From: Pawel Baldysiak @ 2017-07-26 14:41 UTC (permalink / raw)
To: jes.sorensen; +Cc: linux-raid, Pawel Baldysiak
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>
---
super1.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/super1.c b/super1.c
index 86ec850d..b15a1c7a 100644
--- a/super1.c
+++ b/super1.c
@@ -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)
--
2.13.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] super1: Always round data offset to 1M
2017-07-26 14:41 [PATCH 1/1] super1: Always round data offset to 1M Pawel Baldysiak
@ 2017-07-27 9:32 ` Jes Sorensen
0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2017-07-27 9:32 UTC (permalink / raw)
To: Pawel Baldysiak; +Cc: linux-raid
On 07/26/2017 10:41 AM, Pawel Baldysiak wrote:
> 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>
> ---
> super1.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Applied
Thanks,
Jes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-27 9:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-26 14:41 [PATCH 1/1] super1: Always round data offset to 1M Pawel Baldysiak
2017-07-27 9:32 ` Jes Sorensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).