Package: release.debian.org
Severity: normal
Tags: d-i
User: release.debian....@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: k...@debian.org
Control: affects -1 + src:fuse3

Hi RMs,

Please pre-approve unblocking of package fuse3.

[ Reason ]
There are some last minute fixes that would be good to have. There is
a pthread function check to use it only if it's available. A deadlock
fix only affects an example. A session handling fix if an application
uses multiple sessions and receives termination (SIGTERM) signals.
Self-testing fix that thought it had cached results and failed. Then
make special_funcs in its build system more reliable during
cross-compilation.

[ Impact ]
All of these edge cases expect one. We have the pthread function, the
deadlock fix is only in the example, self-testing is no-opt as buildds
don't have the fuse kernel module needed, then we do native
compilation.
But without the session handling fix, applications would hang as they
would not handle SIGTERM correctly. I can strip down the changes only
to this fix, but all have its place.

[ Tests ]
Local self user testing.

[ Risks ]
As fuse3 has an udeb, it affects the installer, but I don't think any
of these changes may cause any issue. But to be safe I added KiBi to
the loop.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

[ Other info ]
I've created the diff myself to exclude noise in the doc directory. As
some source line numbers changed, the HTML references changed as well.
diff -Nur -x doc fuse3-3.17.1+git250416/AUTHORS fuse3-3.17.2/AUTHORS
--- fuse3-3.17.1+git250416/AUTHORS	2025-03-24 13:25:30.000000000 +0100
+++ fuse3-3.17.2/AUTHORS	2025-04-24 01:16:19.000000000 +0200
@@ -271,3 +271,7 @@
 # New authors since fuse-3.17.1-rc1
 jnr0006 <jacob.nick.ri...@gmail.com>
 Vassili Tchersky <vt+...@vbc.su>
+
+# New authors since fuse-3.17.1
+swj <1186093...@qq.com>
+Ben Dooks <ben.do...@codethink.co.uk>
diff -Nur -x doc fuse3-3.17.1+git250416/ChangeLog.rst fuse3-3.17.2/ChangeLog.rst
--- fuse3-3.17.1+git250416/ChangeLog.rst	2025-03-24 13:25:30.000000000 +0100
+++ fuse3-3.17.2/ChangeLog.rst	2025-04-24 01:16:19.000000000 +0200
@@ -1,3 +1,19 @@
+libfuse 3.17.2 (2025-04-23)
+===========================
+* Fixed uninitized bufsize value (compilation warning and real
+  issue when HAVE_SPLICE was not defined)
+* Fixed initialization races related to buffer realocation when
+  large buf sizes are used (/proc/sys/fs/fuse/max_pages_limit)
+* Fix build with kernel < 5.9
+* Fix static_assert build failure with C++ version < 11
+* Compilation fix (remove second fuse_main_real_versioned declaration)
+* Another conn.want flag conversion fix for high-level applications
+* Check if pthread_setname_np() exists before use it
+* fix example/memfs_ll rename deadlock error
+* signal handlers: Store fuse_session unconditionally and restore
+  previous behavior that with multiple sessions the last session
+  was used for the signal exist handler
+
 libfuse 3.17.1 (2025-03-24)
 ===========================
 * fuse: Fix want conn.want flag conversion
diff -Nur -x doc fuse3-3.17.1+git250416/debian/changelog fuse3-3.17.2/debian/changelog
--- fuse3-3.17.1+git250416/debian/changelog	2025-04-16 18:35:53.000000000 +0200
+++ fuse3-3.17.2/debian/changelog	2025-04-27 08:10:01.000000000 +0200
@@ -1,3 +1,15 @@
+fuse3 (3.17.2-1) unstable; urgency=medium
+
+  * New upstream release:
+    - check if pthread_setname_np() exists before use it,
+    - fix example/memfs_ll rename deadlock error,
+    - signal handlers: Store fuse_session unconditionally.
+  * Backport upstream fixes:
+    - fix meson function tests,
+    - meson.build: make special_funcs check more reliable.
+
+ -- Laszlo Boszormenyi (GCS) <g...@debian.org>  Sun, 27 Apr 2025 08:10:01 +0200
+
 fuse3 (3.17.1+git250416-1) unstable; urgency=medium
 
   * New git snapshot release:
diff -Nur -x doc fuse3-3.17.1+git250416/debian/patches/Fix_meson_function_tests.patch fuse3-3.17.2/debian/patches/Fix_meson_function_tests.patch
--- fuse3-3.17.1+git250416/debian/patches/Fix_meson_function_tests.patch	1970-01-01 01:00:00.000000000 +0100
+++ fuse3-3.17.2/debian/patches/Fix_meson_function_tests.patch	2025-04-27 08:10:01.000000000 +0200
@@ -0,0 +1,117 @@
+From 1df74208ea060b32e11b14e9b97049207ed03dd3 Mon Sep 17 00:00:00 2001
+From: Bernd Schubert <bschub...@ddn.com>
+Date: Thu, 24 Apr 2025 16:49:08 +0200
+Subject: [PATCH] Fix meson function tests
+
+Several meson tests were incorrectly failing
+
+Checking for function "static_assert" : NO (cached)
+Checking for function "pthread_setname_np" : NO (cached)
+Check usable header "#include <linux/close_range.h>" : NO (cached)
+
+These functions get now tested with compilation tests
+and get found on my system.
+
+Checking if "static_assert check" compiles: YES
+Checking if "pthread_setname_np check" compiles: YES
+Checking if "close_range check" compiles: YES
+
+Signed-off-by: Bernd Schubert <bschub...@ddn.com>
+Signed-off-by: Giulio Benetti <giulio.bene...@benettiengineering.com>
+---
+ meson.build | 67 +++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 49 insertions(+), 18 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index ba551ed53..d1346d090 100644
+--- a/meson.build
++++ b/meson.build
+@@ -59,6 +59,8 @@ include_default = '''
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <assert.h>     /* For static_assert */
++#include <pthread.h>    /* For pthread_setname_np */
+ '''
+ args_default = [ '-D_GNU_SOURCE' ]
+ 
+@@ -72,32 +74,61 @@ private_cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
+ # Test for presence of some functions
+ test_funcs = [ 'fork', 'fstatat', 'openat', 'readlinkat', 'pipe2',
+                'splice', 'vmsplice', 'posix_fallocate', 'fdatasync',
+-               'utimensat', 'copy_file_range', 'fallocate', 'static_assert',
+-               'pthread_setname_np' ]
++               'utimensat', 'copy_file_range', 'fallocate' ]
+ foreach func : test_funcs
+     private_cfg.set('HAVE_' + func.to_upper(),
+         cc.has_function(func, prefix: include_default, args: args_default))
+ endforeach
+-private_cfg.set('HAVE_SETXATTR', 
+-        cc.has_function('setxattr', prefix: '#include <sys/xattr.h>'))
+-private_cfg.set('HAVE_ICONV', 
+-        cc.has_function('iconv', prefix: '#include <iconv.h>'))
+-private_cfg.set('HAVE_BACKTRACE',
+-        cc.has_function('backtrace', prefix: '#include <execinfo.h>'))
+ 
+-# Test if headers exist
+-private_cfg.set('HAVE_LINUX_CLOSE_RANGE_H',
+-        cc.check_header('#include <linux/close_range.h>'))
++# Special case checks that need custom code
++special_funcs = {
++    'static_assert': '''
++        #include <assert.h>
++        static_assert(1, "test");
++        int main(void) { return 0; }
++    ''',
++    'pthread_setname_np': '''
++        #include <pthread.h>
++        int main(void) {
++            pthread_t thread = pthread_self();
++            pthread_setname_np(thread, "test");
++            return 0;
++        }
++    ''',
++    'close_range': '''
++        #include <unistd.h>
++        #include <fcntl.h>
++        #include <linux/close_range.h>
++        int main(void) {
++            unsigned int flags = CLOSE_RANGE_UNSHARE;
++            return close_range(3, ~0U, flags);
++        }
++    '''
++}
++
++foreach name, code : special_funcs
++    private_cfg.set('HAVE_' + name.to_upper(),
++        cc.compiles(code, args: ['-Werror'] + args_default,
++                 name: name + ' check'))
++endforeach
++
++# Regular function checks
++private_cfg.set('HAVE_SETXATTR',
++    cc.has_function('setxattr', prefix: '#include <sys/xattr.h>'))
++private_cfg.set('HAVE_ICONV',
++    cc.has_function('iconv', prefix: '#include <iconv.h>'))
++private_cfg.set('HAVE_BACKTRACE',
++    cc.has_function('backtrace', prefix: '#include <execinfo.h>'))
+ 
+-# Test if structs have specific member
++# Struct member checks
+ private_cfg.set('HAVE_STRUCT_STAT_ST_ATIM',
+-         cc.has_member('struct stat', 'st_atim',
+-                       prefix: include_default,
+-                       args: args_default))
++    cc.has_member('struct stat', 'st_atim',
++                  prefix: include_default + '#include <sys/stat.h>',
++                  args: args_default))
+ private_cfg.set('HAVE_STRUCT_STAT_ST_ATIMESPEC',
+-         cc.has_member('struct stat', 'st_atimespec',
+-                       prefix: include_default,
+-                       args: args_default))
++    cc.has_member('struct stat', 'st_atimespec',
++                  prefix: include_default + '#include <sys/stat.h>',
++                  args: args_default))
+ 
+ #
+ # Compiler configuration
diff -Nur -x doc fuse3-3.17.1+git250416/debian/patches/meson.build-make-special_funcs-check-more-reliable.patch fuse3-3.17.2/debian/patches/meson.build-make-special_funcs-check-more-reliable.patch
--- fuse3-3.17.1+git250416/debian/patches/meson.build-make-special_funcs-check-more-reliable.patch	1970-01-01 01:00:00.000000000 +0100
+++ fuse3-3.17.2/debian/patches/meson.build-make-special_funcs-check-more-reliable.patch	2025-04-27 08:10:01.000000000 +0200
@@ -0,0 +1,37 @@
+From 8e226c6af6f386a88ed53d0a0940ff6b869b372d Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.bene...@benettiengineering.com>
+Date: Fri, 25 Apr 2025 19:00:14 +0200
+Subject: [PATCH] meson.build: make special_funcs check more reliable
+
+Unfortunately while cross-compiling with build tools like Buildroot it
+happens to have repeated flags or anything that could lead to a warning.
+This way the check fails because of a warning not related to the special
+function. So let's use cc.links() and increase minimum meson_version to
+0.60 since cc.links() has been added during that version.
+
+Signed-off-by: Giulio Benetti <giulio.bene...@benettiengineering.com>
+---
+ meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index d1346d090..d3d236dc4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1,6 +1,6 @@
+ project('libfuse3', ['c'],
+         version: '3.17.2',
+-        meson_version: '>= 0.51.0',
++        meson_version: '>= 0.60.0',
+         default_options: [
+             'buildtype=debugoptimized',
+             'c_std=gnu11',
+@@ -108,7 +108,7 @@ special_funcs = {
+ 
+ foreach name, code : special_funcs
+     private_cfg.set('HAVE_' + name.to_upper(),
+-        cc.compiles(code, args: ['-Werror'] + args_default,
++        cc.links(code, args: args_default,
+                  name: name + ' check'))
+ endforeach
+ 
diff -Nur -x doc fuse3-3.17.1+git250416/debian/patches/series fuse3-3.17.2/debian/patches/series
--- fuse3-3.17.1+git250416/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ fuse3-3.17.2/debian/patches/series	2025-04-27 08:10:01.000000000 +0200
@@ -0,0 +1,2 @@
+Fix_meson_function_tests.patch
+meson.build-make-special_funcs-check-more-reliable.patch
diff -Nur -x doc fuse3-3.17.1+git250416/example/memfs_ll.cc fuse3-3.17.2/example/memfs_ll.cc
--- fuse3-3.17.1+git250416/example/memfs_ll.cc	2025-03-24 13:25:30.000000000 +0100
+++ fuse3-3.17.2/example/memfs_ll.cc	2025-04-24 01:16:19.000000000 +0200
@@ -900,6 +900,7 @@
 	Inode *parentInode = nullptr;
 	Inode *newparentInode = nullptr;
 	Dentry *child_dentry = nullptr;
+	Dentry *child_dentry_copy = nullptr;
 	Dentry *existing_dentry = nullptr;
 
 	if (flags & (RENAME_EXCHANGE | RENAME_NOREPLACE)) {
@@ -909,8 +910,8 @@
 
 	Inodes.lock();
 
-	parentInode = Inodes.find(parent);
-	newparentInode = Inodes.find(newparent);
+	parentInode = Inodes.find_locked(parent);
+	newparentInode = Inodes.find_locked(newparent);
 	if (!parentInode || !parentInode->is_dir() || !newparentInode ||
 	    !newparentInode->is_dir()) {
 		error = ENOENT;
@@ -941,9 +942,9 @@
 		existing_dentry->get_inode()->dec_nlink();
 	}
 
+	child_dentry_copy = new Dentry(newname, child_dentry->get_inode());
 	parentInode->remove_child(name);
-	child_dentry->name = newname;
-	newparentInode->add_child(newname, child_dentry);
+	newparentInode->add_child_locked(newname, child_dentry_copy);
 
 out_unlock:
 	parentInode->unlock();
diff -Nur -x doc fuse3-3.17.1+git250416/lib/fuse.c fuse3-3.17.2/lib/fuse.c
--- fuse3-3.17.1+git250416/lib/fuse.c	2025-03-24 13:25:30.000000000 +0100
+++ fuse3-3.17.2/lib/fuse.c	2025-04-24 01:16:19.000000000 +0200
@@ -4917,7 +4917,9 @@
 	struct fuse *f = fuse;
 	int sleep_time;
 
+#ifdef HAVE_PTHREAD_SETNAME_NP
 	pthread_setname_np(pthread_self(), "fuse_prune_nodes");
+#endif
 
 	while(1) {
 		sleep_time = fuse_clean_cache(f);
diff -Nur -x doc fuse3-3.17.1+git250416/lib/fuse_loop_mt.c fuse3-3.17.2/lib/fuse_loop_mt.c
--- fuse3-3.17.1+git250416/lib/fuse_loop_mt.c	2025-03-24 13:25:30.000000000 +0100
+++ fuse3-3.17.2/lib/fuse_loop_mt.c	2025-04-24 01:16:19.000000000 +0200
@@ -132,7 +132,9 @@
 	struct fuse_worker *w = (struct fuse_worker *) data;
 	struct fuse_mt *mt = w->mt;
 
+#ifdef HAVE_PTHREAD_SETNAME_NP
 	pthread_setname_np(pthread_self(), "fuse_worker");
+#endif
 
 	while (!fuse_session_exited(mt->se)) {
 		int isforget = 0;
diff -Nur -x doc fuse3-3.17.1+git250416/lib/fuse_signals.c fuse3-3.17.2/lib/fuse_signals.c
--- fuse3-3.17.1+git250416/lib/fuse_signals.c	2025-03-24 13:25:30.000000000 +0100
+++ fuse3-3.17.2/lib/fuse_signals.c	2025-04-24 01:16:19.000000000 +0200
@@ -150,8 +150,13 @@
 	if (rc < 0)
 		return rc;
 
-	if (fuse_instance == NULL)
-		fuse_instance = se;
+	/*
+	 * needs to be set independently if already set, as some  applications
+	 * may have multiple sessions and might rely on traditional behavior
+	 * that the last session is used.
+	 */
+	fuse_instance = se;
+
 	return 0;
 }
 
@@ -164,8 +169,8 @@
 	if (rc < 0)
 		return rc;
 
-	if (fuse_instance == NULL)
-		fuse_instance = se;
+	/* See fuse_set_signal_handlers, why set unconditionally */
+	fuse_instance = se;
 
 	return 0;
 }
diff -Nur -x doc fuse3-3.17.1+git250416/meson.build fuse3-3.17.2/meson.build
--- fuse3-3.17.1+git250416/meson.build	2025-04-16 18:31:34.000000000 +0200
+++ fuse3-3.17.2/meson.build	2025-04-24 01:16:19.000000000 +0200
@@ -1,5 +1,5 @@
 project('libfuse3', ['c'],
-        version: '3.17.1',
+        version: '3.17.2',
         meson_version: '>= 0.51.0',
         default_options: [
             'buildtype=debugoptimized',
@@ -72,7 +72,8 @@
 # Test for presence of some functions
 test_funcs = [ 'fork', 'fstatat', 'openat', 'readlinkat', 'pipe2',
                'splice', 'vmsplice', 'posix_fallocate', 'fdatasync',
-               'utimensat', 'copy_file_range', 'fallocate', 'static_assert' ]
+               'utimensat', 'copy_file_range', 'fallocate', 'static_assert',
+               'pthread_setname_np' ]
 foreach func : test_funcs
     private_cfg.set('HAVE_' + func.to_upper(),
         cc.has_function(func, prefix: include_default, args: args_default))
diff -Nur -x doc fuse3-3.17.1+git250416/.pc/.quilt_patches fuse3-3.17.2/.pc/.quilt_patches
--- fuse3-3.17.1+git250416/.pc/.quilt_patches	2025-04-27 08:45:19.921688764 +0200
+++ fuse3-3.17.2/.pc/.quilt_patches	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-debian/patches
diff -Nur -x doc fuse3-3.17.1+git250416/.pc/.quilt_series fuse3-3.17.2/.pc/.quilt_series
--- fuse3-3.17.1+git250416/.pc/.quilt_series	2025-04-27 08:45:19.921688764 +0200
+++ fuse3-3.17.2/.pc/.quilt_series	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-series
diff -Nur -x doc fuse3-3.17.1+git250416/.pc/.version fuse3-3.17.2/.pc/.version
--- fuse3-3.17.1+git250416/.pc/.version	2025-04-27 08:45:19.921688764 +0200
+++ fuse3-3.17.2/.pc/.version	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-2

Reply via email to