]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: fix writing metadata updates.
authorNeilBrown <neilb@suse.de>
Mon, 5 Aug 2013 04:21:10 +0000 (14:21 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 5 Aug 2013 04:21:10 +0000 (14:21 +1000)
Recent commit 273989b93a3185c0e4d54f0d1bc404248a92d157
skipped writing some large blocks of 0xFF, but didn't seek
over the space, so subsequent data was written wrongly.

When we don't write, we need to seek.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index 7a7f5fe665118a5c063af2c9dbb62c31e35c857a..20f4f25723e56c4b987a0f2c9c9798574affb79f 100644 (file)
@@ -2907,7 +2907,8 @@ static int __write_ddf_structure(struct dl *d, struct ddf_super *ddf, __u8 type,
                        }
                        if (write(fd, null_aligned, togo) < 0)
                                break;
-               }
+               } else
+                       lseek(fd, conf_size, SEEK_CUR);
        }
        if (i <= n_config)
                goto out;