From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: jes@trained-monkey.org
Cc: linux-raid@vger.kernel.org
Subject: [PATCH] imsm: change wrong size verification
Date: Wed, 21 Apr 2021 16:50:08 +0200 [thread overview]
Message-ID: <20210421145008.8877-1-mariusz.tkaczyk@linux.intel.com> (raw)
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>
---
super-intel.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 6617dd6d..a7052530 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -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));
--
2.26.2
next reply other threads:[~2021-04-21 14:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 14:50 Mariusz Tkaczyk [this message]
2021-05-06 20:40 ` [PATCH] imsm: change wrong size verification Jes Sorensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210421145008.8877-1-mariusz.tkaczyk@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=jes@trained-monkey.org \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox