summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-08-05 06:21:10 +0200
committerNeilBrown <neilb@suse.de>2013-08-05 06:21:10 +0200
commitce45c81986d4a215c117b0084e9455e2b6a3be43 (patch)
tree73b8e27ef3fe787e38187cd4082d135286b6ca7a /super-ddf.c
parenttests/10ddf-fail-twice: New unit test (diff)
downloadmdadm-ce45c81986d4a215c117b0084e9455e2b6a3be43.tar.xz
mdadm-ce45c81986d4a215c117b0084e9455e2b6a3be43.zip
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 <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c3
1 files changed, 2 insertions, 1 deletions
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;