diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-05 09:18:47 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-05 09:18:47 +0200 |
commit | 84de27709913fa6dcb90f535d54cd866f2ba5b7f (patch) | |
tree | 76b9438a4aeebb00a61bdf78749ff3ba55eafa96 | |
parent | 8b1b62dd8fb7baec93c4396230ea6c3cc3513845 (diff) | |
download | mariadb-git-84de27709913fa6dcb90f535d54cd866f2ba5b7f.tar.gz |
Fix error message output if posix_fallocate (trim) is not successfull.
-rw-r--r-- | storage/innobase/os/os0file.cc | 13 | ||||
-rw-r--r-- | storage/xtradb/os/os0file.cc | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 04a94e5aad2..d97f6a39931 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -6355,10 +6355,11 @@ os_file_trim( ut_ad((trim_len % bsize) == 0); ut_ad((len % bsize) == 0); ut_ad(bsize != 0); + ut_ad((off % bsize) == 0); #ifdef UNIV_TRIM_DEBUG - fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu\n", - *slot->write_size, trim_len, len, off); + fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu bz %lu\n", + *slot->write_size, trim_len, len, off, bsize); #endif // Nothing to do if trim length is zero or if actual write @@ -6397,8 +6398,8 @@ os_file_trim( ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: [Warning] fallocate call failed with error code %d.\n" - " InnoDB: start: %lx len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", ret, (slot->offset+len), trim_len, len); + " InnoDB: start: %lu len: %lu payload: %lu\n" + " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", @@ -6442,8 +6443,8 @@ os_file_trim( ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: [Warning] fallocate call failed with error.\n" - " InnoDB: start: %lx len: %du payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", (slot->offset+len), trim_len, len); + " InnoDB: start: %lu len: %lu payload: %lu\n" + " InnoDB: Disabling fallocate for now.\n", off, trim_len, len); os_file_handle_error_no_exit(slot->name, " DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ", diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index fa183d5724d..aa39e7bab7a 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -6458,10 +6458,11 @@ os_file_trim( ut_ad((trim_len % bsize) == 0); ut_ad((len % bsize) == 0); ut_ad(bsize != 0); + ut_ad((off % bsize) == 0); #ifdef UNIV_TRIM_DEBUG - fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu\n", - *slot->write_size, trim_len, len, off); + fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu bz %lu\n", + *slot->write_size, trim_len, len, off, bsize); #endif // Nothing to do if trim length is zero or if actual write @@ -6500,8 +6501,8 @@ os_file_trim( ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: [Warning] fallocate call failed with error code %d.\n" - " InnoDB: start: %lx len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", ret, (slot->offset+len), trim_len, len); + " InnoDB: start: %lu len: %lu payload: %lu\n" + " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", @@ -6545,8 +6546,8 @@ os_file_trim( ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: [Warning] fallocate call failed with error.\n" - " InnoDB: start: %lx len: %du payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", (slot->offset+len), trim_len, len); + " InnoDB: start: %lu len: %lu payload: %lu\n" + " InnoDB: Disabling fallocate for now.\n", off, trim_len, len); os_file_handle_error_no_exit(slot->name, " DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ", |