From: NeilBrown Date: Mon, 5 Aug 2013 04:21:10 +0000 (+1000) Subject: DDF: fix writing metadata updates. X-Git-Tag: mdadm-3.3~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce45c81986d4a215c117b0084e9455e2b6a3be43;p=thirdparty%2Fmdadm.git DDF: fix writing metadata updates. 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 --- diff --git a/super-ddf.c b/super-ddf.c index 7a7f5fe6..20f4f257 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -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;