]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm: fix update=resync regression
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Fri, 9 Feb 2024 13:02:16 +0000 (14:02 +0100)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Tue, 13 Feb 2024 15:01:37 +0000 (16:01 +0100)
mdadm --assemble --update=resync started failing  with the error
"mdadm: --update=resync not understood for 1.x metadata".

It is a regression. Add omitted branch to fix error.

Resubmitted, original author is not responding.
https://lore.kernel.org/linux-raid/ZZqJlCToUS3Qrl4J@bianca.dpss.psy.unipd.it/

Fixes: 7e8daba8b793 ("super1: refactor the code for enum")
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
super1.c

index 5fd2228efbd644a3b02bb59d99ba940c6b95b861..871d19f0398c2492f8598064c716cb7db44faef0 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1348,6 +1348,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);