Skip to content
Permalink
Browse files
InnoDB, XtraDB: handle EOPNOTSUPP from posix_fallocate()
On some libc (like musl[1]), posix_fallocate() is a fallocate() syscall
wrapper, and does not include fallback code like glibc does. In that
case, EOPNOTSUPP is returned if underlying filesystem does not
support fallocate() with mode = 0.

This patch enables falling back to writing zeros when EOPNOTSUPP, fixes
some cases like running on filesystem without proper fallocate support
on Alpine.

[1]: https://git.musl-libc.org/cgit/musl/tree/src/fcntl/posix_fallocate.c?h=v1.2.1
  • Loading branch information
xdavidwu authored and dr-m committed Sep 4, 2020
1 parent f0a57ac commit 3ee2422
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
@@ -2427,6 +2427,7 @@ os_file_set_size(
errno = err;
return false;
case EINVAL:
case EOPNOTSUPP:
/* fall back to the code below */
break;
}
@@ -2716,6 +2716,7 @@ os_file_set_size(
errno = err;
return false;
case EINVAL:
case EOPNOTSUPP:
/* fall back to the code below */
break;
}

0 comments on commit 3ee2422

Please sign in to comment.