From: Neil Brown Date: Mon, 16 Oct 2006 04:39:06 +0000 (+1000) Subject: Flush bitmap file before truncate. X-Git-Tag: mdadm-2.5.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a6748ce2fc70f35b599bd16b76d16a1e48bc0d;p=thirdparty%2Fmdadm.git Flush bitmap file before truncate. Otheriwse the last write happens on fclose which is after ftruncate, to the truncate has no effect. --- diff --git a/bitmap.c b/bitmap.c index a96e444f..768c17fc 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");