Blame SOURCES/0082-super-intel-make-freesize-not-required-for-chunk-siz.patch

01ff50
From 071f839ea549e2a384cd13bba445245cd87e48b1 Mon Sep 17 00:00:00 2001
01ff50
From: Kinga Tanska <kinga.tanska@intel.com>
01ff50
Date: Fri, 28 Oct 2022 04:51:17 +0200
01ff50
Subject: [PATCH 82/83] super-intel: make freesize not required for chunk size
01ff50
 migration
01ff50
01ff50
Freesize is needed to be set for migrations where size of RAID could
01ff50
be changed - expand. It tells how many free space is determined for
01ff50
members. In chunk size migartion freesize is not needed to be set,
01ff50
pointer shouldn't be checked if exists. This commit moves check to
01ff50
condition which contains size calculations, instead of checking it
01ff50
always at the first step.
01ff50
Fix return value when superblock is not set.
01ff50
01ff50
Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
01ff50
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
01ff50
---
01ff50
 super-intel.c | 10 +++++-----
01ff50
 1 file changed, 5 insertions(+), 5 deletions(-)
01ff50
01ff50
diff --git a/super-intel.c b/super-intel.c
01ff50
index 1f5f6eda..89fac626 100644
01ff50
--- a/super-intel.c
01ff50
+++ b/super-intel.c
01ff50
@@ -7719,11 +7719,11 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
01ff50
 		struct intel_super *super = st->sb;
01ff50
 
01ff50
 		/*
01ff50
-		 * Autolayout mode, st->sb and freesize must be set.
01ff50
+		 * Autolayout mode, st->sb must be set.
01ff50
 		 */
01ff50
-		if (!super || !freesize) {
01ff50
-			pr_vrb("freesize and superblock must be set for autolayout, aborting\n");
01ff50
-			return 1;
01ff50
+		if (!super) {
01ff50
+			pr_vrb("superblock must be set for autolayout, aborting\n");
01ff50
+			return 0;
01ff50
 		}
01ff50
 
01ff50
 		if (!validate_geometry_imsm_orom(st->sb, level, layout,
01ff50
@@ -7731,7 +7731,7 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
01ff50
 						 verbose))
01ff50
 			return 0;
01ff50
 
01ff50
-		if (super->orom) {
01ff50
+		if (super->orom && freesize) {
01ff50
 			imsm_status_t rv;
01ff50
 			int count = count_volumes(super->hba, super->orom->dpa,
01ff50
 					      verbose);
01ff50
-- 
01ff50
2.38.1
01ff50