Skip to contentSkip to conversation

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

PATCH Superseded Kinga Tanska 4 participants 4 messages Oct 20, 2022 – Oct 27, 2022 MD RAID

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

Freesize is not required when chunk size migration is performed. 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
#1 lore raw
Quoted 6 lines

2022年10月20日 12:59,Kinga Tanska <[email protected]> 写道:

Freesize is not required when chunk size migration is performed. Fix return value when superblock is not set.

Hi Kinga,

Could you please provide a bit more information why freesize is unnecessary in this situation?

Thanks.

Coly Li

Quoted 38 lines

---
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
#2 lore raw
Quoted 51 lines · On Fri, 21 Oct 2022 14:49:16 +0800 Coly Li <[email protected]> wrote:
Quoted 6 lines

2022年10月20日 12:59,Kinga Tanska <[email protected]> 写道:

Freesize is not required when chunk size migration is performed. Fix return value when superblock is not set.

Hi Kinga,

Could you please provide a bit more information why freesize is unnecessary in this situation?

Thanks.

Coly Li

Quoted 34 lines

---
super-intel.c | 10 +++++-----

1 file changed, 5 insertions(+), 5 deletions(-)
super-intel.c +0 -0
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;

		/*
super-intel.c +0 -1
-		 * Autolayout mode, st->sb and freesize must be

set.

super-intel.c +1 -0
+		 * Autolayout mode, st->sb must be set.
		 */
super-intel.c +0 -2
-		if (!super || !freesize) {
-			pr_vrb("freesize and superblock must be

set for autolayout, aborting\n");

super-intel.c +2 -1
-			return 1;
+		if (!super) {
+			pr_vrb("superblock must be set for

autolayout, aborting\n");

super-intel.c +1 -0
+			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;

Quoted 9 lines
Quoted 8 lines
super-intel.c +1 -1
-		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

Hi,

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 migration freesize is not needed to be set, so we shouldn't check if pointer exists. I moved this check to condition which contains size calculations, instead of checking it always at the first step.
We've tested it internally with both, chunk size migration and expand and freesize is checked only when is really needed now.

Regards,
Kinga Tanska

#3 lore raw
Quoted 76 lines · Kinga Tanska
Quoted 51 lines · On Fri, 21 Oct 2022 14:49:16 +0800 Coly Li <[email protected]> wrote:
Quoted 6 lines

2022年10月20日 12:59,Kinga Tanska <[email protected]> 写道:

Freesize is not required when chunk size migration is performed. Fix return value when superblock is not set.

Hi Kinga,

Could you please provide a bit more information why freesize is unnecessary in this situation?

Thanks.

Coly Li

Quoted 34 lines

---
super-intel.c | 10 +++++-----

1 file changed, 5 insertions(+), 5 deletions(-)
super-intel.c +0 -0
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.

super-intel.c +1 -2
+            * Autolayout mode, st->sb must be set.
             */
-           if (!super || !freesize) {
-                   pr_vrb("freesize and superblock must be

set for autolayout, aborting\n");

super-intel.c +2 -1
-                   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;

Quoted 9 lines
Quoted 8 lines
super-intel.c +1 -1
-           if (super->orom) {
+           if (super->orom && freesize) {
                    imsm_status_t rv;
                    int count = count_volumes(super->hba,

super->orom->dpa, verbose);
--
2.26.2

Hi,

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 migration freesize is not needed to be set, so we shouldn't check if pointer exists. I moved this check to condition which contains size calculations, instead of checking it always at the first step.
We've tested it internally with both, chunk size migration and expand and freesize is checked only when is really needed now.

Quoted 3 lines

Regards,
Kinga Tanska

Hi Kinga

Could you send the v2 with the detailed explanation?

Regards
Xiao