Skip to contentSkip to conversation

mdadm: Fix array size mismatch after grow

PATCH RESEND Applied Lukasz Florczak 2 participants 4 messages Jul 22, 2022 – Jul 28, 2022 MD RAID

lore
Share & tools
lore
#0 lore raw

v2 cover mdadm: Fix array size mismatch after grow

Changes in v2:
- split commit into two,
- explain dead code part,
- reformat commit body to wrap text after 72 characters.

Lukasz Florczak (2):
mdadm: Fix array size mismatch after grow
mdadm: Remove dead code in imsm_fix_size_mismatch

 super-intel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH RESEND v2 1/2 mdadm: Fix array size mismatch after grow

imsm_fix_size_mismatch() is invoked to fix the problem, but it couldn't proceed due to migration check. This patch allows for intended behavior.

---
 super-intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
super-intel.c +1 -1
index d5fad102..102689bc 100644
@@ -11757,7 +11757,7 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index)
 		unsigned long long d_size = imsm_dev_size(dev);
 		int u_size;
 
-		if (calc_size == d_size || dev->vol.migr_type == MIGR_GEN_MIGR)
+		if (calc_size == d_size)
 			continue;
 
 		/* There is a difference, confirm that imsm_dev_size is
Signature · 1 line
2.27.0
#2 lore raw

PATCH RESEND v2 2/2 mdadm: Remove dead code in imsm_fix_size_mismatch

In reply to Lukasz Florczak

imsm_create_metadata_update_for_size_change() that returns u_size value could return 0 in the past. As its behavior changed, and returned value is always the size of imsm_update_size_change structure, check for u_size is no longer needed.

---
 super-intel.c | 4 ----
 1 file changed, 4 deletions(-)
super-intel.c +0 -4
index 102689bc..cb5292e1 100644
@@ -11772,10 +11772,6 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index)
 		geo.size = d_size;
 		u_size = imsm_create_metadata_update_for_size_change(st, &geo,
 								     &update);
-		if (u_size < 1) {
-			dprintf("imsm: Cannot prepare size change update\n");
-			goto exit;
-		}
 		imsm_update_metadata_locally(st, update, u_size);
 		if (st->update_tail) {
 			append_metadata_update(st, update, u_size);
Signature · 1 line
2.27.0
Applied
#3 lore raw
In reply to Lukasz Florczak
Quoted 5 lines · Lukasz Florczak

Changes in v2:
- split commit into two,
- explain dead code part,
- reformat commit body to wrap text after 72 characters.

Quoted 7 lines

Lukasz Florczak (2):
mdadm: Fix array size mismatch after grow
mdadm: Remove dead code in imsm_fix_size_mismatch

 super-intel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Applied!

Sorry about the delay, I am still catching up after finally falling victim to the virus at the beginning of the month.

Thanks,
Jes