summaryrefslogtreecommitdiff
path: root/innobase/os/os0file.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/os/os0file.c')
-rw-r--r--innobase/os/os0file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 34e13b80c58..94908ae9ade 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -690,6 +690,7 @@ os_file_set_size(
ulint n_bytes;
ibool ret;
byte* buf;
+ byte* buf2;
ulint i;
ut_a(size == (size & 0xFFFFFFFF));
@@ -697,7 +698,10 @@ os_file_set_size(
/* We use a very big 8 MB buffer in writing because Linux may be
extremely slow in fsync on 1 MB writes */
- buf = ut_malloc(UNIV_PAGE_SIZE * 512);
+ buf2 = ut_malloc(UNIV_PAGE_SIZE * 513);
+
+ /* Align the buffer for possible raw i/o */
+ buf = ut_align(buf2, UNIV_PAGE_SIZE);
/* Write buffer full of zeros */
for (i = 0; i < UNIV_PAGE_SIZE * 512; i++) {
@@ -725,7 +729,7 @@ os_file_set_size(
offset += n_bytes;
}
- ut_free(buf);
+ ut_free(buf2);
ret = os_file_flush(file);