diff options
Diffstat (limited to 'storage/innobase/os/os0file.cc')
-rw-r--r-- | storage/innobase/os/os0file.cc | 93 |
1 files changed, 61 insertions, 32 deletions
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 4c1529ac835..525b537ddd7 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Copyright (c) 2013, 2015, MariaDB Corporation. @@ -800,7 +800,7 @@ os_file_handle_error_cond_exit( os_has_said_disk_full = TRUE; fflush(stderr); - + ut_error; return(FALSE); case OS_FILE_AIO_RESOURCES_RESERVED: @@ -2937,13 +2937,18 @@ try_again: if (fil_page_is_compressed((byte *)buf)) { fil_decompress_page(NULL, (byte *)buf, n, NULL); } - return(TRUE); + } else if (ret == -1) { + ib_logf(IB_LOG_LEVEL_ERROR, + "Error in system call pread(). The operating" + " system error number is %lu.",(ulint) errno); + } else { + /* Partial read occured */ + ib_logf(IB_LOG_LEVEL_ERROR, + "Tried to read " ULINTPF " bytes at offset " + UINT64PF ". Was only able to read %ld.", + n, offset, (lint) ret); } - - ib_logf(IB_LOG_LEVEL_ERROR, - "Tried to read " ULINTPF " bytes at offset " UINT64PF ". " - "Was only able to read %ld.", n, offset, (lint) ret); #endif /* __WIN__ */ #ifdef __WIN__ error_handling: @@ -3081,8 +3086,17 @@ try_again: if (fil_page_is_compressed((byte *)buf)) { fil_decompress_page(NULL, (byte *)buf, n, NULL); } - return(TRUE); + } else if (ret == -1) { + ib_logf(IB_LOG_LEVEL_ERROR, + "Error in system call pread(). The operating" + " system error number is %lu.",(ulint) errno); + } else { + /* Partial read occured */ + ib_logf(IB_LOG_LEVEL_ERROR, + "Tried to read " ULINTPF " bytes at offset " + UINT64PF ". Was only able to read %ld.", + n, offset, (lint) ret); } #endif /* __WIN__ */ #ifdef __WIN__ @@ -3302,18 +3316,26 @@ retry: if (!os_has_said_disk_full) { ut_print_timestamp(stderr); - fprintf(stderr, - " InnoDB: Error: Write to file %s failed" - " at offset " UINT64PF ".\n" - "InnoDB: %lu bytes should have been written," - " only %ld were written.\n" - "InnoDB: Operating system error number %lu.\n" - "InnoDB: Check that your OS and file system" - " support files of this size.\n" - "InnoDB: Check also that the disk is not full" - " or a disk quota exceeded.\n", - name, offset, n, (lint) ret, - (ulint) errno); + if(ret == -1) { + ib_logf(IB_LOG_LEVEL_ERROR, + "Failure of system call pwrite(). Operating" + " system error number is %lu.", + (ulint) errno); + } else { + fprintf(stderr, + " InnoDB: Error: Write to file %s failed" + " at offset " UINT64PF ".\n" + "InnoDB: %lu bytes should have been written," + " only %ld were written.\n" + "InnoDB: Operating system error number %lu.\n" + "InnoDB: Check that your OS and file system" + " support files of this size.\n" + "InnoDB: Check also that the disk is not full" + " or a disk quota exceeded.\n", + name, offset, n, (lint) ret, + (ulint) errno); + } + if (strerror(errno) != NULL) { fprintf(stderr, "InnoDB: Error number %d means '%s'.\n", @@ -3500,8 +3522,9 @@ os_file_get_status( stat_info->type = OS_FILE_TYPE_LINK; break; case S_IFBLK: - stat_info->type = OS_FILE_TYPE_BLOCK; - break; + /* Handle block device as regular file. */ + case S_IFCHR: + /* Handle character device as regular file. */ case S_IFREG: stat_info->type = OS_FILE_TYPE_FILE; break; @@ -3510,8 +3533,8 @@ os_file_get_status( } - if (check_rw_perm && (stat_info->type == OS_FILE_TYPE_FILE - || stat_info->type == OS_FILE_TYPE_BLOCK)) { + if (check_rw_perm && stat_info->type == OS_FILE_TYPE_FILE) { + int fh; int access; @@ -4977,7 +5000,7 @@ os_aio_func( mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER); DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - mode = OS_AIO_SYNC;); + mode = OS_AIO_SYNC; os_has_said_disk_full = FALSE;); if (mode == OS_AIO_SYNC #ifdef WIN_ASYNC_IO @@ -5011,6 +5034,10 @@ os_aio_func( DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", os_has_said_disk_full = FALSE; ret = 0; errno = 28;); + + if (!ret) { + os_file_handle_error_cond_exit(name, "os_file_write_func", TRUE, FALSE, __FILE__, __LINE__); + } } return ret; } @@ -5906,18 +5933,20 @@ consecutive_loop: ret = os_file_write( aio_slot->name, aio_slot->file, combined_buf, aio_slot->offset, total_len); - } else { - ret = os_file_read( - aio_slot->file, combined_buf, - aio_slot->offset, total_len, - aio_slot->page_compression); - } - if (aio_slot->type == OS_FILE_WRITE) { DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", os_has_said_disk_full = FALSE; ret = 0; errno = 28;); + + if (!ret) { + os_file_handle_error_cond_exit(aio_slot->name, "os_file_write_func", TRUE, FALSE, __FILE__, __LINE__); + } + + } else { + ret = os_file_read( + aio_slot->file, combined_buf, + aio_slot->offset, total_len, aio_slot->page_compression); } srv_set_io_thread_op_info(global_segment, "file i/o done"); |