diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2021-04-21 16:50:08 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2021-05-06 22:40:29 +0200 |
commit | ff904202a4a6232e0f0dfea31a7c4a34ab08f76e (patch) | |
tree | ebda20f737d796378b9718bb49b25c6915cb36fc | |
parent | Release mdadm-4.2-rc1 (diff) | |
download | mdadm-ff904202a4a6232e0f0dfea31a7c4a34ab08f76e.tar.xz mdadm-ff904202a4a6232e0f0dfea31a7c4a34ab08f76e.zip |
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.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r-- | super-intel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/super-intel.c b/super-intel.c index 876e077c..be0313d5 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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)); |