Skip to content

Commit

Permalink
InnoDB: suppress posix_fallocate() failure errors when EINVAL
Browse files Browse the repository at this point in the history
EINVAL means that the filesystem doesn't support posix_fallocate().

There were two places where this error was issued, one checked for
EINVAL, the other did not. This commit fixed the other place
to also check for EINVAL.

Also, remove the space after the REFMAN to get the valid url
with no space in the middle.

Also don't say "Make sure the file system supports this function."
when posix_fallocate() fails, because this message is only shown
when the filesystem does support this function.
  • Loading branch information
vuvova committed Feb 13, 2017
1 parent ef0db6b commit 6c4144a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ fil_write_zeros(
return(err);
}


/** Try to extend a tablespace.
@param[in,out] space tablespace to be extended
@param[in,out] node last file of the tablespace
Expand Down Expand Up @@ -1136,10 +1137,9 @@ fil_space_extend_must_retry(
" Operating system error number "
<< ret << ". Check"
" that the disk is not full or a disk quota"
" exceeded. Make sure the file system supports"
" this function. Some operating system error"
" exceeded. Some operating system error"
" numbers are described at " REFMAN
" operating-system-error-codes.html";
"operating-system-error-codes.html";
} else
#endif
if (DB_SUCCESS != fil_write_zeros(
Expand Down Expand Up @@ -3734,7 +3734,9 @@ fil_ibd_create(
*/
int ret = posix_fallocate(file, 0, size * UNIV_PAGE_SIZE);

if (ret != 0) {
if (ret == 0) {
success = true;
} else if (ret != EINVAL) {
ib::error() <<
"posix_fallocate(): Failed to preallocate"
" data for file " << path
Expand All @@ -3743,13 +3745,10 @@ fil_ibd_create(
<< " Operating system error number " << ret
<< ". Check"
" that the disk is not full or a disk quota"
" exceeded. Make sure the file system supports"
" this function. Some operating system error"
" exceeded. Some operating system error"
" numbers are described at " REFMAN
" operating-system-error-codes.html";
} else {
success = true;
}
"operating-system-error-codes.html";
}
#endif /* HAVE_POSIX_FALLOCATE */

if (!success) {
Expand Down

0 comments on commit 6c4144a

Please sign in to comment.