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

Allow for more file system support by making a choice to use posix_fallocate instead of fallocate #46

Open
HansMeijer-AvidentIT opened this issue Jul 28, 2019 · 2 comments

Comments

@HansMeijer-AvidentIT
Copy link

In the chunkio code there are system calls to expand files by using the system call "fallocate" that limits usage to certain file system types, this is mainly due to performance reasons.

To support more file systems apart from XFS, ext4 etc, it would be good if there could be an option to use posix_fallocate and let the decision on performance be up to usage and configurable.

@edsiper
Copy link
Member

edsiper commented Aug 7, 2019

thanks, this will be added (no ETA)

@sirwio
Copy link
Contributor

sirwio commented Mar 25, 2021

While the pull request #64 addresses the issue on modern linux operating system it still fails on older linuxes e.g. Suse 11 SP4

suse:/chunkio # ./cio -e 5  -p 400kb.txt
[src/cio_file.c:332 errno=95] Operation not supported
[chunkio] cannot adjust chunk size '/tmp/cio-perf//test-perf/perf-test-0000.txt' to 4096 bytes
[src/cio_file.c:332 errno=95] Operation not supported
[chunkio] cannot adjust chunk size '/tmp/cio-perf//test-perf/perf-test-0001.txt' to 4096 bytes
[src/cio_file.c:332 errno=95] Operation not supported
[chunkio] cannot adjust chunk size '/tmp/cio-perf//test-perf/perf-test-0002.txt' to 4096 bytes
[src/cio_file.c:332 errno=95] Operation not supported
[chunkio] cannot adjust chunk size '/tmp/cio-perf//test-perf/perf-test-0003.txt' to 4096 bytes
[src/cio_file.c:332 errno=95] Operation not supported
[chunkio] cannot adjust chunk size '/tmp/cio-perf//test-perf/perf-test-0004.txt' to 4096 bytes
=== perf write ===
-  crc32 checksum : disabled
-  fs sync mode   : normal
-  file size      : 400.0K (409600 bytes)
-  total files    : 5
-  file writes    : 5
-  bytes written  : 0b (0 bytes)
-  elapsed time   : 0.00 seconds
-  rate           : 0b per second (0.00 bytes)
suse:/chunkio # cat /etc/SuSE-
SuSE-brand    SuSE-release
suse:/chunkio # cat /etc/SuSE-
SuSE-brand    SuSE-release
suse:/chunkio # cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 4

This is due to the call to fallocate does not return EOPNOTSUPP but rather -1 with the errno 95 (Operation not supported).

To support older operating system it would be better to check for non zero return codes and revert to posix_fallocate in such case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants