summaryrefslogtreecommitdiffstats
path: root/bitmap.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-10-16 14:39:06 +1000
committerNeil Brown <neilb@suse.de>2006-10-16 14:39:06 +1000
commit97a6748ce2fc70f35b599bd16b76d16a1e48bc0d (patch)
treed183f9373cbc045d46a51a9c4ea3c84337bc6ccd /bitmap.c
parent0a816ef9fb8202707cc76a943678307c252939cf (diff)
downloadmdadm-97a6748ce2fc70f35b599bd16b76d16a1e48bc0d.tar.gz
mdadm-97a6748ce2fc70f35b599bd16b76d16a1e48bc0d.tar.xz
mdadm-97a6748ce2fc70f35b599bd16b76d16a1e48bc0d.zip
Flush bitmap file before truncate.
Otheriwse the last write happens on fclose which is after ftruncate, to the truncate has no effect.
Diffstat (limited to 'bitmap.c')
-rw-r--r--bitmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bitmap.c b/bitmap.c
index a96e444..768c17f 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -390,6 +390,7 @@ int CreateBitmap(char *filename, int force, char uuid[16],
}
rv = 0;
+ fflush(fp);
/* make the file be the right size (well, to the nearest byte) */
if (ftruncate(fileno(fp), filesize))
perror("ftrunace");