aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.c
diff options
context:
space:
mode:
authorBernd Schubert <bernd@bsbernd.com>2025-03-22 23:57:55 +0100
committerBernd Schubert <bernd@bsbernd.com>2025-03-24 10:29:15 +0100
commitf52f71df3373185c4d18414aad57c4e8995a4393 (patch)
treec29e5167670efc2d399e00cece46fc03e62b0c20 /lib/helper.c
parentcdad7b6001036f1a33bddab59558eec099bcb278 (diff)
downloadlibfuse-f52f71df3373185c4d18414aad57c4e8995a4393.tar.gz
fuse: Fix want flag conversion
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> (cherry picked from commit f68970cd235a7e14026ca0f6240428bbebe8223b)
Diffstat (limited to 'lib/helper.c')
-rw-r--r--lib/helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/helper.c b/lib/helper.c
index a7b2fe0..59dd488 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -424,9 +424,9 @@ void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts,
conn->max_readahead = opts->max_readahead;
#define LL_ENABLE(cond,cap) \
- if (cond) conn->want |= (cap)
+ if (cond) conn->want_ext |= (cap)
#define LL_DISABLE(cond,cap) \
- if (cond) conn->want &= ~(cap)
+ if (cond) conn->want_ext &= ~(cap)
LL_ENABLE(opts->splice_read, FUSE_CAP_SPLICE_READ);
LL_DISABLE(opts->no_splice_read, FUSE_CAP_SPLICE_READ);