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

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