diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/fil/fil0pagecompress.cc | 10 | ||||
-rw-r--r-- | storage/innobase/os/os0file.cc | 17 | ||||
-rw-r--r-- | storage/xtradb/fil/fil0pagecompress.cc | 10 | ||||
-rw-r--r-- | storage/xtradb/os/os0file.cc | 17 |
4 files changed, 38 insertions, 16 deletions
diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 68a7163897f..52f3792f649 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -456,9 +456,15 @@ fil_compress_page( /* Actual write needs to be alligned on block size */ if (write_size % block_size) { +#ifdef UNIV_DEBUG + size_t tmp = write_size; ut_a(block_size > 0); - write_size = (write_size + block_size-1) & ~(block_size-1); - ut_a((write_size % block_size) == 0); +#endif + write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size); +#ifdef UNIV_DEBUG + ut_a(write_size > 0 && ((write_size % block_size) == 0)); + ut_a(write_size >= tmp); +#endif } #ifdef UNIV_PAGECOMPRESS_DEBUG diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 31ddd05829c..04a94e5aad2 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -5018,12 +5018,12 @@ os_aio_func( ret = os_file_write_func(name, file, buf, offset, n); } - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - os_has_said_disk_full = FALSE;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - ret = 0;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - errno = 28;); + if (type == OS_FILE_WRITE) { + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", + os_has_said_disk_full = FALSE; + ret = 0; + errno = 28;); + } return ret; } @@ -6356,6 +6356,11 @@ os_file_trim( ut_ad((len % bsize) == 0); ut_ad(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); +#endif + // Nothing to do if trim length is zero or if actual write // size is initialized and it is smaller than current write size. // In first write if we trim we set write_size to actual bytes diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index a4b0e1b486b..3852bc49408 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -453,9 +453,15 @@ fil_compress_page( /* Actual write needs to be alligned on block size */ if (write_size % block_size) { +#ifdef UNIV_DEBUG + size_t tmp = write_size; ut_a(block_size > 0); - write_size = (write_size + block_size-1) & ~(block_size-1); - ut_a((write_size % block_size) == 0); +#endif + write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size); +#ifdef UNIV_DEBUG + ut_a(write_size > 0 && ((write_size % block_size) == 0)); + ut_a(write_size >= tmp); +#endif } #ifdef UNIV_PAGECOMPRESS_DEBUG diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 18ccc3350cf..fa183d5724d 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -5115,12 +5115,12 @@ os_aio_func( ret = os_file_write(name, file, buf, offset, n); } - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - os_has_said_disk_full = FALSE;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - ret = 0;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - errno = 28;); + if (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) { fprintf(stderr, "FAIL"); @@ -6459,6 +6459,11 @@ os_file_trim( ut_ad((len % bsize) == 0); ut_ad(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); +#endif + // Nothing to do if trim length is zero or if actual write // size is initialized and it is smaller than current write size. // In first write if we trim we set write_size to actual bytes |