linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Janna <andrea1@newsletter.dpss.psy.unipd.it>
To: linux-raid@vger.kernel.org
Subject: mdadm: --update=resync not understood for 1.x metadata
Date: Sun, 7 Jan 2024 12:23:00 +0100	[thread overview]
Message-ID: <ZZqJlCToUS3Qrl4J@bianca.dpss.psy.unipd.it> (raw)

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.

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

             reply	other threads:[~2024-01-07 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-07 11:23 Andrea Janna [this message]
2024-01-08 11:02 ` mdadm: --update=resync not understood for 1.x metadata Mariusz Tkaczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZZqJlCToUS3Qrl4J@bianca.dpss.psy.unipd.it \
    --to=andrea1@newsletter.dpss.psy.unipd.it \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).