Blame SOURCES/0001-imsm-change-wrong-size-verification.patch

7140c6
From ff904202a4a6232e0f0dfea31a7c4a34ab08f76e Mon Sep 17 00:00:00 2001
7140c6
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7140c6
Date: Wed, 21 Apr 2021 16:50:08 +0200
7140c6
Subject: [PATCH 01/15] imsm: change wrong size verification
7140c6
7140c6
Expectation that size is always rounded is incorrect.
7140c6
Just confirm that size is smaller to be certain that update is safe.
7140c6
7140c6
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7140c6
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
7140c6
---
7140c6
 super-intel.c | 10 +++++-----
7140c6
 1 file changed, 5 insertions(+), 5 deletions(-)
7140c6
7140c6
diff --git a/super-intel.c b/super-intel.c
7140c6
index 876e077..be0313d 100644
7140c6
--- a/super-intel.c
7140c6
+++ b/super-intel.c
7140c6
@@ -11823,12 +11823,12 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index)
7140c6
 		if (calc_size == d_size || dev->vol.migr_type == MIGR_GEN_MIGR)
7140c6
 			continue;
7140c6
 
7140c6
-		/* There is a difference, verify that imsm_dev_size is
7140c6
-		 * rounded correctly and push update.
7140c6
+		/* There is a difference, confirm that imsm_dev_size is
7140c6
+		 * smaller and push update.
7140c6
 		 */
7140c6
-		if (d_size != round_size_to_mb(d_size, disc_count)) {
7140c6
-			dprintf("imsm: Size of volume %d is not rounded correctly\n",
7140c6
-				 i);
7140c6
+		if (d_size > calc_size) {
7140c6
+			pr_err("imsm: dev size of subarray %d is incorrect\n",
7140c6
+				i);
7140c6
 			goto exit;
7140c6
 		}
7140c6
 		memset(&geo, 0, sizeof(struct geo_params));
7140c6
-- 
7140c6
2.7.5
7140c6