Skip to contentSkip to conversation

imsm: change wrong size verification

PATCH Applied Mariusz Tkaczyk 2 participants 2 messages Apr 21, 2021 – May 6, 2021 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imsm: change wrong size verification

Expectation that size is always rounded is incorrect. Just confirm that size is smaller to be certain that update is safe.

---
 super-intel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
super-intel.c +5 -5
index 6617dd6d..a7052530 100644
@@ -11817,12 +11817,12 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index)
 		if (calc_size == d_size || dev->vol.migr_type == MIGR_GEN_MIGR)
 			continue;
 
-		/* There is a difference, verify that imsm_dev_size is
-		 * rounded correctly and push update.
+		/* There is a difference, confirm that imsm_dev_size is
+		 * smaller and push update.
 		 */
-		if (d_size != round_size_to_mb(d_size, disc_count)) {
-			dprintf("imsm: Size of volume %d is not rounded correctly\n",
-				 i);
+		if (d_size > calc_size) {
+			pr_err("imsm: dev size of subarray %d is incorrect\n",
+				i);
 			goto exit;
 		}
 		memset(&geo, 0, sizeof(struct geo_params));
Signature · 1 line
2.26.2
Applied
#1 lore raw
Quoted 7 lines · Mariusz Tkaczyk

Expectation that size is always rounded is incorrect. Just confirm that size is smaller to be certain that update is safe.

---
 super-intel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Applied!

Thanks,
Jes