Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/cio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,10 +1049,10 @@ 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.
if (ret != 0) {
/* If fallocate fails with an non zero return code 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);
}
Expand Down