Skip to contentSkip to conversation

super-intel: make freesize not required for chunk size migration

PATCH Applied Kinga Tanska 2 participants 2 messages Oct 28, 2022 – Jan 5, 2023 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 super-intel: make freesize not required for chunk size migration

Freesize is needed to be set for migrations where size of RAID could be changed - expand. It tells how many free space is determined for members. In chunk size migartion freesize is not needed to be set, pointer shouldn't be checked if exists. This commit moves check to condition which contains size calculations, instead of checking it always at the first step.
Fix return value when superblock is not set.

---
 super-intel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
super-intel.c +5 -5
index 4d82af3d..37c59da5 100644
@@ -7714,11 +7714,11 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
 		struct intel_super *super = st->sb;
 
 		/*
-		 * Autolayout mode, st->sb and freesize must be set.
+		 * Autolayout mode, st->sb must be set.
 		 */
-		if (!super || !freesize) {
-			pr_vrb("freesize and superblock must be set for autolayout, aborting\n");
-			return 1;
+		if (!super) {
+			pr_vrb("superblock must be set for autolayout, aborting\n");
+			return 0;
 		}
 
 		if (!validate_geometry_imsm_orom(st->sb, level, layout,
@@ -7726,7 +7726,7 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
 						 verbose))
 			return 0;
 
-		if (super->orom) {
+		if (super->orom && freesize) {
 			imsm_status_t rv;
 			int count = count_volumes(super->hba, super->orom->dpa,
 					      verbose);
Signature · 1 line
2.26.2
Applied
#1 lore raw
Quoted 8 lines · Kinga Tanska

Freesize is needed to be set for migrations where size of RAID could be changed - expand. It tells how many free space is determined for members. In chunk size migartion freesize is not needed to be set, pointer shouldn't be checked if exists. This commit moves check to condition which contains size calculations, instead of checking it always at the first step.
Fix return value when superblock is not set.

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

Applied!

Thanks,
Jes