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

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