Commit baad0f34 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-11520 post-fix: Retry posix_fallocate() on EINTR in fil_ibd_create()

Earlier versions of MariaDB only use posix_fallocate() when extending
data files, not when initially creating the files,
parent 07cb4646
......@@ -3858,17 +3858,20 @@ fil_ibd_create(
success= false;
#ifdef HAVE_POSIX_FALLOCATE
/*
Extend the file using posix_fallocate(). This is required by
FusionIO HW/Firmware but should also be the prefered way to extend
a file.
*/
int ret = posix_fallocate(file, 0, size * UNIV_PAGE_SIZE);
if (ret == 0) {
/*
Extend the file using posix_fallocate(). This is required by
FusionIO HW/Firmware but should also be the prefered way to extend
a file.
*/
int ret;
do {
ret = posix_fallocate(file, 0, size * UNIV_PAGE_SIZE);
} while (ret != 0 && ret != EINTR);
if (ret == 0) {
success = true;
} else if (ret != EINVAL) {
ib::error() <<
ib::error() <<
"posix_fallocate(): Failed to preallocate"
" data for file " << path
<< ", desired size "
......
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