]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
DDF: don't assume the anchor is fully up-to-date.
[thirdparty/mdadm.git] / super-ddf.c
index e4553d27553010cabbb62223a44354f7dc4ddcb1..91b1797f8e206445ec76f3581f5e8701349c17e9 100644 (file)
@@ -3095,6 +3095,7 @@ static int _write_super_to_disk(struct ddf_super *ddf, struct dl *d)
         */
        get_dev_size(fd, NULL, &size);
        size /= 512;
+       memcpy(&ddf->anchor, ddf->active, 512);
        if (be64_to_cpu(d->workspace_lba) != 0ULL)
                ddf->anchor.workspace_lba = d->workspace_lba;
        else
@@ -3110,7 +3111,6 @@ static int _write_super_to_disk(struct ddf_super *ddf, struct dl *d)
        else
                ddf->anchor.secondary_lba =
                        cpu_to_be64(size - 32*1024*2);
-       ddf->anchor.seq = ddf->active->seq;
        ddf->anchor.timestamp = cpu_to_be32(time(0) - DECADE);
        memcpy(&ddf->primary, &ddf->anchor, 512);
        memcpy(&ddf->secondary, &ddf->anchor, 512);