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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-03-10 17:06:59 +11:00
parent 66dedd88e6
commit a4622ac62c
1 changed files with 1 additions and 1 deletions

2
Grow.c
View File

@ -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));