dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/super1-Always-round-data-offset-to-1M.patch

2c1b57
From 795bd44ed11aafbed2628ba21216c667371e79a5 Mon Sep 17 00:00:00 2001
2c1b57
From: Pawel Baldysiak <pawel.baldysiak@intel.com>
2c1b57
Date: Wed, 26 Jul 2017 16:41:54 +0200
2c1b57
Subject: [RHEL7.5 PATCH 159/169] super1: Always round data offset to 1M
2c1b57
2c1b57
Currently if metadata requires more then 1M,
2c1b57
data offset will be rounded down to closest MB.
2c1b57
This is not correct, since less then required space is reserved.
2c1b57
Always round data offset up to multiple of 1M.
2c1b57
2c1b57
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 super1.c | 3 +--
2c1b57
 1 file changed, 1 insertion(+), 2 deletions(-)
2c1b57
2c1b57
diff --git a/super1.c b/super1.c
2c1b57
index 86ec850..b15a1c7 100644
2c1b57
--- a/super1.c
2c1b57
+++ b/super1.c
2c1b57
@@ -2796,8 +2796,7 @@ static int validate_geometry1(struct supertype *st, int level,
2c1b57
 				headroom >>= 1;
2c1b57
 			data_offset = 12*2 + bmspace + headroom;
2c1b57
 			#define ONE_MEG (2*1024)
2c1b57
-			if (data_offset > ONE_MEG)
2c1b57
-				data_offset = (data_offset / ONE_MEG) * ONE_MEG;
2c1b57
+			data_offset = ROUND_UP(data_offset, ONE_MEG);
2c1b57
 			break;
2c1b57
 		}
2c1b57
 	if (st->data_offset == INVALID_SECTORS)
2c1b57
-- 
2c1b57
2.7.4
2c1b57