]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Flush bitmap file before truncate.
authorNeil Brown <neilb@suse.de>
Mon, 16 Oct 2006 04:39:06 +0000 (14:39 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 16 Oct 2006 04:39:06 +0000 (14:39 +1000)
Otheriwse the last write happens on fclose which is after ftruncate,
to the truncate has no effect.

bitmap.c

index a96e444f5d0383bb0e161dc847b12d7b54f098be..768c17fc0bb480b79917490e6a4a6a77263d2994 100644 (file)
--- 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");