diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-06 14:33:07 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-06 14:33:14 +0300 |
commit | baad0f3484ec3079a09a206576290091cc823428 (patch) | |
tree | 2d3b8553213ebec8bf74be83de40d96d63332815 | |
parent | 07cb4646c6494dd6dc6ab74668250875f49dee47 (diff) | |
download | mariadb-git-baad0f3484ec3079a09a206576290091cc823428.tar.gz |
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,
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 93279667466..9905ab7d24f 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -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 " |