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

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