aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_write_cache.c
AgeCommit message (Collapse)AuthorLines
2025-03-24fuse: Fix want flag conversionBernd Schubert-1/+1
32-bit conn->want flags been left to be ABI compatible to 3.10, even though the so version was changed. The more recent way is to use fuse_set_feature_flag(), which will use conn->want_ext. Given that we now have two flags (want and want_ext), we need to convert and that brought several issues - If the application sets conn->want, that needs to be set into the lower 32 bit of conn->want_ext. As the application might actually unset values, it really has to be a copy and not just 'or' - fixed now. - convert_to_conn_want_ext() actually needs to check for _modified_ conn->want and conn->want_ext - convert_to_conn_want_ext() must consider being called from high and lowlevel interfact, with different want_ext_default and want_default values. It is only a failure, if the application changed both, conn->want and conn->want_ext. This function was failing in issue #1171, because high level fuse_fs_init() was changing values and then lowlevel do_init() was incorrectly failing on that. This also adds a new test (test_want_conversion) and sets values into example/{hello.c,hello_ll.c} Also some more internal users of conn->want are converted to fuse_{set,unset}_feature_flag(). Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-24test/test_write_cache.c: Reformat with clang-formatBernd Schubert-204/+212
The file is going to be updated - should be more conform Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-01-03Fix libfuse build with FUSE_USE_VERSION 30Amir Goldstein-0/+3
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2024-12-30Add 64-bit conn::{capable,want}_ext fieldsBernd Schubert-1/+1
The previous fields are left for ABI compatibility, although it is not beautiful to add that complexity when we have to increase the so-version as we had ABI breakage anyway. example/printcap is simplified to use an array, as every line would have needed to be modified anyway. Missing 'FUSE_CAP_PASSTHROUGH' was added. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-06-25Use off_t instead of loff_tCismonX-3/+1
Since we're already enforcing 64-bit off_t, using loff_t makes no difference. Also loff_t is Linux-only, which breaks compatibility for *BSD.
2024-03-06Fix undefined loff_t in test_write_cache.c on alpineBernd Schubert-0/+2
This fixes #899. Seems that Alpine (and maybe Fedora) need _GNU_SOURCE to get loff_t.
2024-02-26Fix tests/test_write_cache in write back mode (#892)Bernd Schubert-8/+33
This test could fail whenever a something (kernel, userspace) decides to flush in between of two 2048B writes. These two writes are supposed to be merged into a single 4906 byte write by the kernel writeback cache, but _sometimes_ the test fails because 2048 byte writes get through. Fixes #882 Solution here is a modification how the test works - instead of requiring an exact aggregation of 2x2048B into 4096B, it now writes 64x2048B and requires in write-back modes the number of received writes requests is lower than 64 - we can expect that at least some writes get aggregated, but we do know how many. Co-authored-by: Bernd Schubert <bschubert@ddn.com>
2023-07-01Reduce default write size by halfNikolaus Rath-1/+1
Hopefully this will reduce test flakiness on CI.
2023-07-01Add missing include.Nikolaus Rath-0/+1
2023-01-28Install a the configure_file (config.h) and use in headersBernd Schubert-1/+1
This addresses: https://github.com/libfuse/libfuse/issues/724 HAVE_LIBC_VERSIONED_SYMBOLS configures the library if to use versioned symbols and is set at meson configuration time. External filesystems (the main target, actually) include fuse headers and the preprocessor then acts on HAVE_LIBC_VERSIONED_SYMBOLS. Problem was now that 'config.h' was not distributed with libfuse and so HAVE_LIBC_VERSIONED_SYMBOLS was never defined with external tools and the preprocessor did the wrong decision. This commit also increases the the minimal meson version, as this depends on meson feature only available in 0.50 <quote 'meson' > WARNING: Project specifies a minimum meson_ version '>= 0.42' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'} </quote> Additionally the config file has been renamed to "fuse_config.h" to avoid clashes - 'config.h' is not very specific.
2022-01-05Add test for FOPEN_NOFLUSH flagAmir Goldstein-1/+60
Simulate write() delay and verify that close(rofd) does not block waiting on pending writes. The support for the flag was added in kernel v5.16-rc1. Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2020-03-13State GPL version in comment (#485)Dr. David Alan Gilbert-1/+1
IN a bunch of comments we say 'under the terms of the GNU GPL', make it clear this is GPLv2 (as LICENSE says). Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2018-07-23test_write_cache: Use fuse_session_exit() to stop filesystem threadRostislav Skudnov-2/+3
Using fuse_session_exit() followed by fuse_session_unmount() ensures that a proper cleanup and shutdown is performed.
2018-07-23test_write_cache: Fix memory leaksRostislav Skudnov-0/+3
2017-08-24Don't use -o auto_unmount under FreeBSD.Nikolaus Rath-0/+2
2017-05-24Make tests build on bsdBrian Naylor-0/+5
2016-11-06Don't hardcode test file name.Nikolaus Rath-1/+1
2016-10-15Unify handling of fuse_conn_info optionsNikolaus Rath-1/+11
Instead of using command line options to modify struct fuse_conn_info before and after calling the init() handler, we now give the file system explicit control over this.
2016-10-10Added write cache tests.Nikolaus Rath-0/+206