Skip to content

Commit

Permalink
MDEV-11520 Properly retry posix_fallocate() on EINTR
Browse files Browse the repository at this point in the history
We only want to retry posix_fallocate() on EINTR as long as the system
is not being shut down. We do not want to retry on any other (hard) error.

Thanks to Jocelyn Fournier for quickly noticing the mistake in my
previous commit.
  • Loading branch information
dr-m committed May 6, 2017
1 parent 14c6f00 commit 6c91be5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3866,7 +3866,8 @@ fil_ibd_create(
int ret;
do {
ret = posix_fallocate(file, 0, size * UNIV_PAGE_SIZE);
} while (ret != 0 && ret != EINTR);
} while (ret == EINTR
&& srv_shutdown_state == SRV_SHUTDOWN_NONE);

if (ret == 0) {
success = true;
Expand Down

0 comments on commit 6c91be5

Please sign in to comment.