From: NeilBrown Date: Thu, 10 Mar 2011 06:06:59 +0000 (+1100) Subject: Initialise all of file when opening backup file for reshape. X-Git-Tag: mdadm-3.1.5~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4622ac62c92280318b43d479e9abc4415ac2bfa;p=thirdparty%2Fmdadm.git Initialise all of file when opening backup file for reshape. Due to a miscalculation we didn't initialise the whole file. There is 4K (8 sectors) for the metadata, then the data. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 0571f5b0..7db54de2 100644 --- a/Grow.c +++ b/Grow.c @@ -1054,7 +1054,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, break; } memset(buf, 0, 512); - for (i=0; i < (signed)blocks + 1 ; i++) { + for (i=0; i < (signed)blocks + 8 ; i++) { if (write(fdlist[d], buf, 512) != 512) { fprintf(stderr, Name ": %s: cannot create backup file %s: %s\n", devname, backup_file, strerror(errno));