Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address issue of falures on ext3 and reiserfs filesystems #64

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,13 @@ int cio_file_fs_size_change(struct cio_file *cf, size_t new_size)
* fallocate() is not portable, Linux only.
*/
ret = fallocate(cf->fd, 0, 0, new_size);
if (ret == EOPNOTSUPP) {
/* If fallocate fails with an EOPNOTSUPP try operation using
* posix_fallocate. Required since some filesystems do not support
* the fallocate operation e.g. ext3 and reiserfs.
*/
ret = posix_fallocate(cf->fd, 0, new_size);
sirwio marked this conversation as resolved.
Show resolved Hide resolved
}
}
else
#endif
Expand Down