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

This commit is contained in:
Jan Lindström 2014-11-05 09:18:47 +02:00
parent 8b1b62dd8f
commit 84de277099
2 changed files with 14 additions and 12 deletions

View File

@ -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) ",

View File

@ -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) ",