From 3863da58b1f7904675ca050434d8219bc410f34a Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Wed, 16 Apr 2025 00:24:42 +0200 Subject: conn: prevent duplicate flag conversion in high-level interface The high-level interface triggers flag conversion twice: once in the high-level init and once in the low-level init. This caused false "both 'want' and 'want_ext' are set" errors when using fuse_set_feature_flag() or fuse_unset_feature_flag(). The existing check for duplicate conversion only worked when 32-bit flags were set directly. When using the preferred flag manipulation functions, conn->want and the lower 32 bits of conn->want_ext would differ, triggering the error. Fix this by synchronizing conn->want with the lower 32 bits of conn->want_ext after conversion, ensuring consistent state for subsequent calls. Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert --- example/hello.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/hello.c b/example/hello.c index 90919f4..d9f01b9 100644 --- a/example/hello.c +++ b/example/hello.c @@ -59,8 +59,8 @@ static void *hello_init(struct fuse_conn_info *conn, cfg->kernel_cache = 1; /* Test setting flags the old way */ - conn->want = FUSE_CAP_ASYNC_READ; - conn->want &= ~FUSE_CAP_ASYNC_READ; + fuse_set_feature_flag(conn, FUSE_CAP_ASYNC_READ); + fuse_unset_feature_flag(conn, FUSE_CAP_ASYNC_READ); return NULL; } -- cgit v1.2.3