diff mbox series

mdadm: --update=resync not understood for 1.x metadata

Message ID ZZqJlCToUS3Qrl4J@bianca.dpss.psy.unipd.it (mailing list archive)
State Changes Requested
Headers show
Series mdadm: --update=resync not understood for 1.x metadata | expand

Commit Message

Andrea Janna Jan. 7, 2024, 11:23 a.m. UTC
After upgrading mdadm from released version mdadm-4.2 to the current git version the command
mdadm --assemble --update=resync
started failing with the error "mdadm: --update=resync not understood for 1.x metadata".
My array superblock version is 1.0.

I think this is a regression introduced by https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=7e8daba8b7937716dce8ea28298a4e2e72cb829e
This commit deleted the "else if (strcmp(update, "resync") == 0)" code block without replacing it with a switch case.

The following patch fixed the error for me.


Regards,
Andrea Janna

Comments

Mariusz Tkaczyk Jan. 8, 2024, 11:02 a.m. UTC | #1
Hello Andrea,
Thanks for your patch. It looks reasonable.
Please resolve few nits and I will take it.

On Sun, 7 Jan 2024 12:23:00 +0100
Andrea Janna <andrea1@newsletter.dpss.psy.unipd.it> wrote:

I'm not familiar with your mail domain, "newsletter" suggest me that it is not
something I can trust. Could you please update mail address?
I'm afraid that accidentally I may record list for a spam messages as
"newsletter" generally provides them.

> After upgrading mdadm from released version mdadm-4.2 to the current git
> version the command mdadm --assemble --update=resync
> started failing with the error "mdadm: --update=resync not understood for 1.x
> metadata". My array superblock version is 1.0.
> 
> I think this is a regression introduced by
> https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=7e8daba8b7937716dce8ea28298a4e2e72cb829e
> This commit deleted the "else if (strcmp(update, "resync") == 0)" code block
> without replacing it with a switch case.

"I think" it is not something that we can accept in commit message. You provided
patch so I must believe that you are familiar with problem and it is properly
root causes.
In this case, it is obvious that the problem is introduced by this
patch because the solution is a partial revert of the change so please be more
direct, (just skip "I think").

Please read sending patches best practices carefully:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Please run checkpatch script, before sending the patch, it is really helpful:
https://docs.kernel.org/dev-tools/checkpatch.html

Me <mariusz.tkaczyk@linux.intel.com> and Jes <jes@trained-monkey.org> should be
added in --to or --Cc for mdadm patches.

> 
> The following patch fixed the error for me.
> 
> diff --git a/super1.c b/super1.c
> index dfde4629..6f23b9eb 100644
> --- a/super1.c
> +++ b/super1.c
> @@ -1356,6 +1356,10 @@ static int update_super1(struct supertype *st, struct
> mdinfo *info, __cpu_to_le16(info->disk.raid_disk);
>  		break;
>  	}
> +	case UOPT_RESYNC:
> +		/* make sure resync happens */
> +		sb->resync_offset = 0;
> +		break;
>  	case UOPT_UUID:
>  		copy_uuid(sb->set_uuid, info->uuid, super1.swapuuid);
>  
> 
> Regards,
> Andrea Janna
> 
Please sign-off your patch!

Do not forgot to add v2 for sending new version. You can search for examples in
list history:
https://lore.kernel.org/linux-raid/

Thanks,
Mariusz
diff mbox series

Patch

diff --git a/super1.c b/super1.c
index dfde4629..6f23b9eb 100644
--- a/super1.c
+++ b/super1.c
@@ -1356,6 +1356,10 @@  static int update_super1(struct supertype *st, struct mdinfo *info,
 			__cpu_to_le16(info->disk.raid_disk);
 		break;
 	}
+	case UOPT_RESYNC:
+		/* make sure resync happens */
+		sb->resync_offset = 0;
+		break;
 	case UOPT_UUID:
 		copy_uuid(sb->set_uuid, info->uuid, super1.swapuuid);