]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: change wrong size verification
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Wed, 21 Apr 2021 14:50:08 +0000 (16:50 +0200)
committerJes Sorensen <jsorensen@fb.com>
Thu, 6 May 2021 20:40:29 +0000 (16:40 -0400)
Expectation that size is always rounded is incorrect.
Just confirm that size is smaller to be certain that update is safe.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c

index 876e077cf880d558df16f4638afcf93d073644ae..be0313d555a7d9cd7b8ce66673ed2e0ec8eb8a3c 100644 (file)
@@ -11823,12 +11823,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));