Commit 84de2770 authored by Jan Lindström's avatar Jan Lindström

Fix error message output if posix_fallocate (trim) is not successfull.

parent 8b1b62dd
...@@ -6355,10 +6355,11 @@ os_file_trim( ...@@ -6355,10 +6355,11 @@ os_file_trim(
ut_ad((trim_len % bsize) == 0); ut_ad((trim_len % bsize) == 0);
ut_ad((len % bsize) == 0); ut_ad((len % bsize) == 0);
ut_ad(bsize != 0); ut_ad(bsize != 0);
ut_ad((off % bsize) == 0);
#ifdef UNIV_TRIM_DEBUG #ifdef UNIV_TRIM_DEBUG
fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu\n", fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu bz %lu\n",
*slot->write_size, trim_len, len, off); *slot->write_size, trim_len, len, off, bsize);
#endif #endif
// Nothing to do if trim length is zero or if actual write // Nothing to do if trim length is zero or if actual write
...@@ -6397,8 +6398,8 @@ os_file_trim( ...@@ -6397,8 +6398,8 @@ os_file_trim(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error code %d.\n" " InnoDB: [Warning] fallocate call failed with error code %d.\n"
" InnoDB: start: %lx len: %lu payload: %lu\n" " InnoDB: start: %lu len: %lu payload: %lu\n"
" InnoDB: Disabling fallocate for now.\n", ret, (slot->offset+len), trim_len, len); " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len);
os_file_handle_error_no_exit(slot->name, os_file_handle_error_no_exit(slot->name,
" fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ",
...@@ -6442,8 +6443,8 @@ os_file_trim( ...@@ -6442,8 +6443,8 @@ os_file_trim(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error.\n" " InnoDB: [Warning] fallocate call failed with error.\n"
" InnoDB: start: %lx len: %du payload: %lu\n" " InnoDB: start: %lu len: %lu payload: %lu\n"
" InnoDB: Disabling fallocate for now.\n", (slot->offset+len), trim_len, len); " InnoDB: Disabling fallocate for now.\n", off, trim_len, len);
os_file_handle_error_no_exit(slot->name, os_file_handle_error_no_exit(slot->name,
" DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ", " DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ",
......
...@@ -6458,10 +6458,11 @@ os_file_trim( ...@@ -6458,10 +6458,11 @@ os_file_trim(
ut_ad((trim_len % bsize) == 0); ut_ad((trim_len % bsize) == 0);
ut_ad((len % bsize) == 0); ut_ad((len % bsize) == 0);
ut_ad(bsize != 0); ut_ad(bsize != 0);
ut_ad((off % bsize) == 0);
#ifdef UNIV_TRIM_DEBUG #ifdef UNIV_TRIM_DEBUG
fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu\n", fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu off %lu bz %lu\n",
*slot->write_size, trim_len, len, off); *slot->write_size, trim_len, len, off, bsize);
#endif #endif
// Nothing to do if trim length is zero or if actual write // Nothing to do if trim length is zero or if actual write
...@@ -6500,8 +6501,8 @@ os_file_trim( ...@@ -6500,8 +6501,8 @@ os_file_trim(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error code %d.\n" " InnoDB: [Warning] fallocate call failed with error code %d.\n"
" InnoDB: start: %lx len: %lu payload: %lu\n" " InnoDB: start: %lu len: %lu payload: %lu\n"
" InnoDB: Disabling fallocate for now.\n", ret, (slot->offset+len), trim_len, len); " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len);
os_file_handle_error_no_exit(slot->name, os_file_handle_error_no_exit(slot->name,
" fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ",
...@@ -6545,8 +6546,8 @@ os_file_trim( ...@@ -6545,8 +6546,8 @@ os_file_trim(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error.\n" " InnoDB: [Warning] fallocate call failed with error.\n"
" InnoDB: start: %lx len: %du payload: %lu\n" " InnoDB: start: %lu len: %lu payload: %lu\n"
" InnoDB: Disabling fallocate for now.\n", (slot->offset+len), trim_len, len); " InnoDB: Disabling fallocate for now.\n", off, trim_len, len);
os_file_handle_error_no_exit(slot->name, os_file_handle_error_no_exit(slot->name,
" DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ", " DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment