dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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