* [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
The LIST_HEAD macro is defined by both the Linux kernel's list.h and
<sys/queue.h> (originally from BSD). The problem is that on MacOS,
some system header file pulls in <sys/queue.h> leading to a macro
redefiniction conflict. Since we don't use LIST_HEAD in e2fsprogs,
the simplest mitigation is to just comment out the definition of LIST_HEAD.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 37dafcc0894b ("libsupport: port the kernel list.h to libsupport")
---
lib/support/list.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/support/list.h b/lib/support/list.h
index 0e00e446d..0ec8de525 100644
--- a/lib/support/list.h
+++ b/lib/support/list.h
@@ -36,8 +36,17 @@ static inline void list_head_destroy(struct list_head *list)
#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#if 0
+/*
+ * This conflicts with the LIST_HEAD defined in <sys/queue.h>. We
+ * don't include it in e2fsprogs, but some systems' header files might
+ * pull it in, leading to the macro redefinition conflict.
+ * Fortunately, we also don't need LIST_HEAD in e2fsprogs, so just
+ * drop this convenience macro.
+ */
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
+#endif
/**
* INIT_LIST_HEAD - Initialize a list_head structure
--
2.53.0
^ permalink raw reply related
* [PATCH 7/7] fuse2fs: fix uninitialized variable warnings
From: Theodore Ts'o @ 2026-05-04 23:33 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
Clang treats use of unitialized variables found by static analysis to
be serious enough that it will emit them by default (even without
-Wall). So let's fix them up.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
fuse4fs/fuse4fs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index b883083f8..928473268 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -2216,7 +2216,7 @@ static void op_mknod(fuse_req_t req, fuse_ino_t fino, const char *name,
const struct fuse_ctx *ctxt = fuse_req_ctx(req);
struct fuse4fs *ff = fuse4fs_get(req);
ext2_filsys fs;
- ext2_ino_t parent, child;
+ ext2_ino_t parent, child = 0;
errcode_t err;
int filetype;
gid_t gid;
@@ -2311,7 +2311,7 @@ static void op_mkdir(fuse_req_t req, fuse_ino_t fino, const char *name,
const struct fuse_ctx *ctxt = fuse_req_ctx(req);
struct fuse4fs *ff = fuse4fs_get(req);
ext2_filsys fs;
- ext2_ino_t parent, child;
+ ext2_ino_t parent, child = 0;
errcode_t err;
char *block;
blk64_t blk;
@@ -2990,7 +2990,7 @@ static void op_symlink(fuse_req_t req, const char *target, fuse_ino_t fino,
const struct fuse_ctx *ctxt = fuse_req_ctx(req);
struct fuse4fs *ff = fuse4fs_get(req);
ext2_filsys fs;
- ext2_ino_t parent, child;
+ ext2_ino_t parent, child = 0;
errcode_t err;
gid_t gid;
int ret = 0;
@@ -6042,7 +6042,7 @@ static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)
struct fuse_cmdline_opts opts;
struct fuse_session *se;
struct fuse_loop_config *loop_config = NULL;
- int ret;
+ int ret = 0;
if (fuse_parse_cmdline(args, &opts) != 0) {
ret = 1;
--
2.53.0
^ permalink raw reply related
* [PATCH 0/7] fix up issues from djwong/fuse4fs-fork
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
These are the patches that I've applied to the next branch to clean up
found when trying to compile e2fsprogs on MacOS and via the github's
continuous integration testing.
Note: See .github/workflows/ci.yaml; it's a good reason to get a
github account if you are doing a lot of e2fsprogs development.
If you fork my e2fsprogs repository and push your changes to your github
repo, you can get reports like the ones found here:
https://github.com/tytso/e2fsprogs/actions
Anyway, with these patches, e2fsprogs builds on MacOS (both using the
github CI and on locally on my Macbook). Unfortunately fuse2fs has
regressed in that non-root accesses are getting denied with a permission
denied on MacOS, and this worked with e2fsprogs v1.47.4. Here's a
lightly edited transcript from my Macbook Air:
% uname -a
Darwin macsyma.local 25.4.0 Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:09 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8112 arm64 arm Darwin
% ./mke2fs -Fq -t ext4 -d . /tmp/foo.img 1G
% ./fuse2fs -o allow_other /tmp/foo.img /Users/tytso/mnt
FUSE2FS (foo.img): Warning: fuse2fs does not support using the journal.
There may be file system corruption or data loss if
the file system is not gracefully unmounted.
% stat /Users/tytso/mnt/revoke.o
stat: cannot stat '/Users/tytso/mnt/revoke.o': Permission denied
% sudo stat /Users/tytso/mnt/revoke.o
File: /Users/tytso/mnt/revoke.o
Size: 29728 Blocks: 64 IO Block: 16384 regular file
Device: 55,270 Inode: 91 Links: 1
Access: (0644/-rw-r--r--) Uid: (15806/ tytso) Gid: ( 20/ staff)
Access: 2026-05-05 00:21:50.000000000 +0200
Modify: 2026-05-05 00:21:50.000000000 +0200
Change: 2026-05-05 00:21:50.000000000 +0200
Birth: -
% stat revoke.o
File: revoke.o
Size: 29728 Blocks: 64 IO Block: 4096 regular file
Device: 1,18 Inode: 851374 Links: 1
Access: (0644/-rw-r--r--) Uid: (15806/ tytso) Gid: ( 20/ staff)
Access: 2026-05-05 00:21:50.903084819 +0200
Modify: 2026-05-05 00:21:50.346338295 +0200
Change: 2026-05-05 00:21:50.346580544 +0200
Birth: 2026-05-05 00:21:50.293229053 +0200
% sum revoke.o
45116 30 revoke.o
% sum /Users/tytso/mnt/revoke.o
sum: /Users/tytso/mnt/revoke.o: Permission denied
So fuse2fs is broken on MacOS, but it's not *totally* broken, since you
can still use it as root. I'll want to fix this before updating the
master branch, but this is good enough for the next branch.
Theodore Ts'o (7):
libsupport: drop xbitops.h and define fls() if necessary
configure.ac: fix disable fuse2fs/fuse4fs by default path
libsupport: don't use bzero in cache.c
fuse[24]fs: suppress clang warnings which were breaking the github CI
libsupport: remove the LIST_HEAD macro from list.h
libsupport: fix gcc -Wall warnings
fuse2fs: fix uninitialized variable warnings
configure | 8 +++
configure.ac | 3 +
fuse4fs/Makefile.in | 18 +++---
fuse4fs/fuse4fs.c | 29 +++++++--
lib/config.h.in | 3 +
lib/support/Makefile.in | 2 +-
lib/support/cache.c | 49 ++++++++++++---
lib/support/cache.h | 2 +-
lib/support/list.h | 17 ++++--
lib/support/xbitops.h | 128 ----------------------------------------
misc/fuse2fs.c | 21 +++++++
11 files changed, 125 insertions(+), 155 deletions(-)
delete mode 100644 lib/support/xbitops.h
--
2.53.0
^ permalink raw reply
* [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
If the fuse.h header file is not present, fix the "Disabling
fuse[24]fs by default" codepath to actually disable trying to build
fuse2fs or fuse4fs.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 239f4b7ac05b ("fuse2fs: separate libfuse3 and fuse2fs detection in configure")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
configure | 2 ++
configure.ac | 2 ++
2 files changed, 4 insertions(+)
diff --git a/configure b/configure
index a1a270e63..d941ff1f1 100755
--- a/configure
+++ b/configure
@@ -14737,6 +14737,7 @@ else case e in #(
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Enabling fuse2fs by default" >&5
printf "%s\n" "Enabling fuse2fs by default" >&6; }
else
+ FUSE2FS_CMT="#"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling fuse2fs by default" >&5
printf "%s\n" "Disabling fuse2fs by default" >&6; }
fi
@@ -14804,6 +14805,7 @@ else case e in #(
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Enabling fuse4fs by default" >&5
printf "%s\n" "Enabling fuse4fs by default" >&6; }
else
+ FUSE4FS_CMT="#"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling fuse4fs by default" >&5
printf "%s\n" "Disabling fuse4fs by default" >&6; }
fi
diff --git a/configure.ac b/configure.ac
index abce79594..d8f40f5df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1459,6 +1459,7 @@ AS_HELP_STRING([--disable-fuse2fs],[do not build fuse2fs]),
then
AC_MSG_RESULT([Enabling fuse2fs by default])
else
+ FUSE2FS_CMT="#"
AC_MSG_RESULT([Disabling fuse2fs by default])
fi
]
@@ -1496,6 +1497,7 @@ AS_HELP_STRING([--disable-fuse4fs],[do not build fuse4fs]),
then
AC_MSG_RESULT([Enabling fuse4fs by default])
else
+ FUSE4FS_CMT="#"
AC_MSG_RESULT([Disabling fuse4fs by default])
fi
]
--
2.53.0
^ permalink raw reply related
* [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
The new cache.c file doesn't actually need most of the functions in
xbitops.h. It only needs fls(), and on some systems, like MacOS and
*BSD systems, fls() is defined already. The other functions in
xbitops.h are massively non-portable and break on non-Linux systems,
especially MacOS.
So define fls() if it's needed (on Linux), and drop xbitops.h.
Fixes: 30b3c80ed6bc ("libsupport: add a cache")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
configure | 6 ++
configure.ac | 1 +
fuse4fs/Makefile.in | 18 +++---
lib/config.h.in | 3 +
lib/support/Makefile.in | 2 +-
lib/support/cache.c | 33 ++++++++++-
lib/support/xbitops.h | 128 ----------------------------------------
7 files changed, 51 insertions(+), 140 deletions(-)
delete mode 100644 lib/support/xbitops.h
diff --git a/configure b/configure
index a97794121..a1a270e63 100755
--- a/configure
+++ b/configure
@@ -13677,6 +13677,12 @@ if test "x$ac_cv_func_fdatasync" = xyes
then :
printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h
+fi
+ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
+if test "x$ac_cv_func_fls" = xyes
+then :
+ printf "%s\n" "#define HAVE_FLS 1" >>confdefs.h
+
fi
ac_fn_c_check_func "$LINENO" "fstat64" "ac_cv_func_fstat64"
if test "x$ac_cv_func_fstat64" = xyes
diff --git a/configure.ac b/configure.ac
index b62553e3d..abce79594 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1233,6 +1233,7 @@ AC_CHECK_FUNCS(m4_flatten([
fchown
fcntl
fdatasync
+ fls
fstat64
fsync
ftruncate64
diff --git a/fuse4fs/Makefile.in b/fuse4fs/Makefile.in
index 9f3547c27..cecee2b25 100644
--- a/fuse4fs/Makefile.in
+++ b/fuse4fs/Makefile.in
@@ -134,7 +134,7 @@ distclean: clean
$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
# +++ Dependency line eater +++
-#
+#
# Makefile dependencies follow. This must be the last section in
# the Makefile.in file
#
@@ -145,9 +145,10 @@ fuse4fs.o: $(srcdir)/fuse4fs.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
$(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/ext2fsP.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/version.h \
- $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/cache.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/support/xbitops.h
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/support/bthread.h \
+ $(top_srcdir)/lib/support/thread.h $(top_srcdir)/lib/support/list.h \
+ $(top_srcdir)/lib/support/cache.h $(top_srcdir)/version.h \
+ $(top_srcdir)/lib/e2p/e2p.h
journal.o: $(srcdir)/../debugfs/journal.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/../debugfs/journal.h \
$(top_srcdir)/e2fsck/jfs_user.h $(top_srcdir)/e2fsck/e2fsck.h \
@@ -161,8 +162,7 @@ journal.o: $(srcdir)/../debugfs/journal.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h \
$(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h
+ $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(srcdir)/../e2fsck/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -175,8 +175,7 @@ revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h \
$(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h
+ $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(srcdir)/../e2fsck/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -189,5 +188,4 @@ recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h \
$(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h
+ $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
diff --git a/lib/config.h.in b/lib/config.h.in
index fd2520396..abba5e2c6 100644
--- a/lib/config.h.in
+++ b/lib/config.h.in
@@ -124,6 +124,9 @@
/* Define to 1 if you have the 'fdatasync' function. */
#undef HAVE_FDATASYNC
+/* Define to 1 if you have the 'fls' function. */
+#undef HAVE_FLS
+
/* Define to 1 if fsmap_sizeof() is declared in linux/fsmap.h */
#undef HAVE_FSMAP_SIZEOF
diff --git a/lib/support/Makefile.in b/lib/support/Makefile.in
index 6ff1c81d0..d20d6a984 100644
--- a/lib/support/Makefile.in
+++ b/lib/support/Makefile.in
@@ -199,4 +199,4 @@ dict.o: $(srcdir)/dict.c $(top_builddir)/lib/config.h \
devname.o: $(srcdir)/devname.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/devname.h $(srcdir)/nls-enable.h
cache.o: $(srcdir)/cache.c $(top_builddir)/lib/config.h \
- $(srcdir)/cache.h $(srcdir)/list.h $(srcdir)/xbitops.h
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/list.h $(srcdir)/cache.h
diff --git a/lib/support/cache.c b/lib/support/cache.c
index 3a9e276f1..f9669e3fc 100644
--- a/lib/support/cache.c
+++ b/lib/support/cache.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include <pthread.h>
#include <stdbool.h>
@@ -14,9 +15,9 @@
#include <stdint.h>
#include <errno.h>
+#include "config.h"
#include "list.h"
#include "cache.h"
-#include "xbitops.h"
#undef CACHE_DEBUG
/* #define CACHE_DEBUG 1 */
@@ -32,6 +33,36 @@
# define ASSERT(x) do { } while (0)
#endif
+#ifndef HAVE_FLS
+static inline int fls(int x)
+{
+ int r = 32;
+
+ if (!x)
+ return 0;
+ if (!(x & 0xffff0000u)) {
+ x = (x & 0xffffu) << 16;
+ r -= 16;
+ }
+ if (!(x & 0xff000000u)) {
+ x = (x & 0xffffffu) << 8;
+ r -= 8;
+ }
+ if (!(x & 0xf0000000u)) {
+ x = (x & 0xfffffffu) << 4;
+ r -= 4;
+ }
+ if (!(x & 0xc0000000u)) {
+ x = (x & 0x3fffffffu) << 2;
+ r -= 2;
+ }
+ if (!(x & 0x80000000u)) {
+ r -= 1;
+ }
+ return r;
+}
+#endif
+
static unsigned int cache_generic_bulkrelse(struct cache *, struct list_head *);
int
diff --git a/lib/support/xbitops.h b/lib/support/xbitops.h
deleted file mode 100644
index 78a8f2a85..000000000
--- a/lib/support/xbitops.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef __BITOPS_H__
-#define __BITOPS_H__
-
-/*
- * fls: find last bit set.
- */
-
-static inline int fls(int x)
-{
- int r = 32;
-
- if (!x)
- return 0;
- if (!(x & 0xffff0000u)) {
- x = (x & 0xffffu) << 16;
- r -= 16;
- }
- if (!(x & 0xff000000u)) {
- x = (x & 0xffffffu) << 8;
- r -= 8;
- }
- if (!(x & 0xf0000000u)) {
- x = (x & 0xfffffffu) << 4;
- r -= 4;
- }
- if (!(x & 0xc0000000u)) {
- x = (x & 0x3fffffffu) << 2;
- r -= 2;
- }
- if (!(x & 0x80000000u)) {
- r -= 1;
- }
- return r;
-}
-
-static inline int fls64(uint64_t x)
-{
- uint32_t h = x >> 32;
- if (h)
- return fls(h) + 32;
- return fls(x);
-}
-
-static inline unsigned fls_long(unsigned long l)
-{
- if (sizeof(l) == 4)
- return fls(l);
- return fls64(l);
-}
-
-/*
- * ffz: find first zero bit.
- * Result is undefined if no zero bit exists.
- */
-#define ffz(x) ffs(~(x))
-
-/*
- * XFS bit manipulation routines. Repeated here so that some programs
- * don't have to link in all of libxfs just to have bit manipulation.
- */
-
-/*
- * masks with n high/low bits set, 64-bit values
- */
-static inline uint64_t mask64hi(int n)
-{
- return (uint64_t)-1 << (64 - (n));
-}
-static inline uint32_t mask32lo(int n)
-{
- return ((uint32_t)1 << (n)) - 1;
-}
-static inline uint64_t mask64lo(int n)
-{
- return ((uint64_t)1 << (n)) - 1;
-}
-
-/* Get high bit set out of 32-bit argument, -1 if none set */
-static inline int highbit32(uint32_t v)
-{
- return fls(v) - 1;
-}
-
-/* Get high bit set out of 64-bit argument, -1 if none set */
-static inline int highbit64(uint64_t v)
-{
- return fls64(v) - 1;
-}
-
-/* Get low bit set out of 32-bit argument, -1 if none set */
-static inline int lowbit32(uint32_t v)
-{
- return ffs(v) - 1;
-}
-
-/* Get low bit set out of 64-bit argument, -1 if none set */
-static inline int lowbit64(uint64_t v)
-{
- uint32_t w = (uint32_t)v;
- int n = 0;
-
- if (w) { /* lower bits */
- n = ffs(w);
- } else { /* upper bits */
- w = (uint32_t)(v >> 32);
- if (w) {
- n = ffs(w);
- if (n)
- n += 32;
- }
- }
- return n - 1;
-}
-
-/**
- * __rounddown_pow_of_two() - round down to nearest power of two
- * @n: value to round down
- */
-static inline __attribute__((const))
-unsigned long __rounddown_pow_of_two(unsigned long n)
-{
- return 1UL << (fls_long(n) - 1);
-}
-
-#define rounddown_pow_of_two(n) __rounddown_pow_of_two(n)
-
-#endif
--
2.53.0
^ permalink raw reply related
* [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
fuse[24]fs.c defines some functions which might or might not be used
depending on the version of the fuse library installed on the system.
Unfortunately while gcc won't complain if there are static inline
functions which are not used, clang will only suppress such complaints
if the static inline functions are in a header file.
Since the github CI runs a test build with -Wall -Werror this was
breaking the CI build.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
fuse4fs/fuse4fs.c | 21 +++++++++++++++++++++
misc/fuse2fs.c | 21 +++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index 13e1aae4b..b883083f8 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -502,6 +502,27 @@ static inline off_t FUSE4FS_FSB_TO_B(const struct fuse4fs *ff, blk64_t bno)
return bno << ff->blocklog;
}
+#ifdef __clang__
+#define SUPPRESS_UNUSED_FUNCTION(func) (void)func
+/*
+ * These functions might or might not be used depending on the version
+ * of the fuse library installed on the system. Unfortunately while
+ * gcc won't complain if there are static inline functions which are
+ * not used, clang will only suppress such complaints if the static
+ * inline functions are in a header file.
+ */
+void fuse2fs_shut_up_stupid_clang_warnings(void)
+{
+ SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
+ SUPPRESS_UNUSED_FUNCTION(round_up);
+ SUPPRESS_UNUSED_FUNCTION(round_down);
+ SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSBT);
+ SUPPRESS_UNUSED_FUNCTION(FUSE4FS_OFF_IN_FSB);
+ SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSB);
+ SUPPRESS_UNUSED_FUNCTION(FUSE4FS_FSB_TO_B);
+}
+#endif
+
static double gettime_monotonic(void)
{
#ifdef CLOCK_MONOTONIC
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 0f4781bc4..c46cfc236 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -339,6 +339,27 @@ static inline off_t FUSE2FS_FSB_TO_B(const struct fuse2fs *ff, blk64_t bno)
return bno << ff->blocklog;
}
+#ifdef __clang__
+#define SUPPRESS_UNUSED_FUNCTION(func) (void)func
+/*
+ * These functions might or might not be used depending on the version
+ * of the fuse library installed on the system. Unfortunately while
+ * gcc won't complain if there are static inline functions which are
+ * not used, clang will only suppress such complaints if the static
+ * inline functions are in a header file.
+ */
+void fuse2fs_shut_up_stupid_clang_warnings(void)
+{
+ SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
+ SUPPRESS_UNUSED_FUNCTION(round_up);
+ SUPPRESS_UNUSED_FUNCTION(round_down);
+ SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSBT);
+ SUPPRESS_UNUSED_FUNCTION(FUSE2FS_OFF_IN_FSB);
+ SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSB);
+ SUPPRESS_UNUSED_FUNCTION(FUSE2FS_FSB_TO_B);
+}
+#endif
+
static double gettime_monotonic(void)
{
#ifdef CLOCK_MONOTONIC
--
2.53.0
^ permalink raw reply related
* [PATCH 3/7] libsupport: don't use bzero in cache.c
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
The bzero() function is deprecated and not available in some
platforms. It's not needed in any case because we can just use an
automatic initializer.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 30b3c80ed6bc ("libsupport: add a cache")
---
lib/support/cache.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/support/cache.c b/lib/support/cache.c
index f9669e3fc..aec785347 100644
--- a/lib/support/cache.c
+++ b/lib/support/cache.c
@@ -850,7 +850,7 @@ cache_report(
{
int i;
unsigned long count, index, total;
- unsigned long hash_bucket_lengths[HASH_REPORT + 2];
+ unsigned long hash_bucket_lengths[HASH_REPORT + 2] = { 0 };
if ((cache->c_hits + cache->c_misses) == 0)
return;
@@ -886,8 +886,6 @@ cache_report(
cache->c_mrus[i].cm_count * 100 / cache->c_count);
/* report hash bucket lengths */
- bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths));
-
for (i = 0; i < cache->c_hashsize; i++) {
count = cache->c_hash[i].ch_count;
if (count > HASH_REPORT)
--
2.53.0
^ permalink raw reply related
* [syzbot] [ocfs2?] [ext4?] general protection fault in jbd2_journal_dirty_metadata (2)
From: syzbot @ 2026-05-04 22:27 UTC (permalink / raw)
To: jack, jlbec, joseph.qi, linux-ext4, linux-kernel, mark,
ocfs2-devel, syzkaller-bugs, tytso
Hello,
syzbot found the following issue on:
HEAD commit: 08d0d3466664 Merge tag 'net-7.1-rc2' of git://git.kernel.o..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=152f81ce580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4caf64b1ee83dac0
dashboard link: https://syzkaller.appspot.com/bug?extid=98f651460e558a21baae
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1415f2d2580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=132f81ce580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c5abd4fcc5ba/disk-08d0d346.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/896c46fd9ce9/vmlinux-08d0d346.xz
kernel image: https://storage.googleapis.com/syzbot-assets/04a44a684bb3/bzImage-08d0d346.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/b6c8c7ca94d0/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=14e8a082580000)
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+98f651460e558a21baae@syzkaller.appspotmail.com
(syz.2.23,6028,0):__ocfs2_remove_xattr_range:786 ERROR: status = -30
(syz.2.23,6028,0):ocfs2_xattr_shrink_size:840 ERROR: status = -30
(syz.2.23,6028,0):__ocfs2_journal_access:724 ERROR: Error -30 getting 1 access to buffer!
(syz.2.23,6028,0):ocfs2_xa_prepare_entry:2182 ERROR: status = -30
(syz.2.23,6028,0):ocfs2_xa_set:2285 ERROR: status = -30
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 6028 Comm: syz.2.23 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
RIP: 0010:jbd2_journal_dirty_metadata+0x4a/0xd30 fs/jbd2/transaction.c:1520
Code: 00 fc ff df e8 07 27 29 ff 4c 89 fd 48 c1 ed 03 42 80 7c 35 00 00 74 08 4c 89 ff e8 f0 61 94 ff 49 8b 1f 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 d7 61 94 ff 48 89 1c 24 4c 8b 2b
RSP: 0018:ffffc90003766bc0 EFLAGS: 00010256
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff888035c3dc40
RDX: 0000000000000000 RSI: ffff88805927b9f8 RDI: ffff888034ddbf20
RBP: 1ffff110069bb7e4 R08: ffffffff9030a1f7 R09: 1ffffffff206143e
R10: dffffc0000000000 R11: fffffbfff206143f R12: dffffc0000000000
R13: 1ffff920006ecd94 R14: dffffc0000000000 R15: ffff888034ddbf20
FS: 000055556c64d500(0000) GS:ffff888125290000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8ff9c72700 CR3: 000000007908f000 CR4: 0000000000350ef0
Call Trace:
<TASK>
ocfs2_journal_dirty+0x130/0x700 fs/ocfs2/journal.c:831
ocfs2_xa_journal_dirty fs/ocfs2/xattr.c:1483 [inline]
ocfs2_xa_set+0x15e3/0x2ec0 fs/ocfs2/xattr.c:2294
ocfs2_xattr_block_set+0x3e0/0x33c0 fs/ocfs2/xattr.c:3016
__ocfs2_xattr_set_handle+0x6b3/0xf50 fs/ocfs2/xattr.c:3418
ocfs2_xattr_set+0xf3f/0x13e0 fs/ocfs2/xattr.c:3681
__vfs_setxattr+0x43c/0x480 fs/xattr.c:218
__vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:252
vfs_setxattr+0x163/0x360 fs/xattr.c:339
do_setxattr fs/xattr.c:654 [inline]
filename_setxattr+0x296/0x630 fs/xattr.c:682
path_setxattrat+0x3eb/0x440 fs/xattr.c:726
__do_sys_setxattr fs/xattr.c:760 [inline]
__se_sys_setxattr fs/xattr.c:756 [inline]
__x64_sys_setxattr+0xbc/0xe0 fs/xattr.c:756
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8ff9d9cdd9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd9c92e118 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 00007f8ffa015fa0 RCX: 00007f8ff9d9cdd9
RDX: 0000000000000000 RSI: 0000200000000140 RDI: 0000200000000080
RBP: 00007f8ff9e32d69 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8ffa015fac R14: 00007f8ffa015fa0 R15: 00007f8ffa015fa0
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:jbd2_journal_dirty_metadata+0x4a/0xd30 fs/jbd2/transaction.c:1520
Code: 00 fc ff df e8 07 27 29 ff 4c 89 fd 48 c1 ed 03 42 80 7c 35 00 00 74 08 4c 89 ff e8 f0 61 94 ff 49 8b 1f 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 d7 61 94 ff 48 89 1c 24 4c 8b 2b
RSP: 0018:ffffc90003766bc0 EFLAGS: 00010256
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff888035c3dc40
RDX: 0000000000000000 RSI: ffff88805927b9f8 RDI: ffff888034ddbf20
RBP: 1ffff110069bb7e4 R08: ffffffff9030a1f7 R09: 1ffffffff206143e
R10: dffffc0000000000 R11: fffffbfff206143f R12: dffffc0000000000
R13: 1ffff920006ecd94 R14: dffffc0000000000 R15: ffff888034ddbf20
FS: 000055556c64d500(0000) GS:ffff888125290000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557909eb6950 CR3: 000000007908f000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 4 bytes skipped:
0: e8 07 27 29 ff call 0xff29270c
5: 4c 89 fd mov %r15,%rbp
8: 48 c1 ed 03 shr $0x3,%rbp
c: 42 80 7c 35 00 00 cmpb $0x0,0x0(%rbp,%r14,1)
12: 74 08 je 0x1c
14: 4c 89 ff mov %r15,%rdi
17: e8 f0 61 94 ff call 0xff94620c
1c: 49 8b 1f mov (%r15),%rbx
1f: 48 89 d8 mov %rbx,%rax
22: 48 c1 e8 03 shr $0x3,%rax
* 26: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) <-- trapping instruction
2b: 74 08 je 0x35
2d: 48 89 df mov %rbx,%rdi
30: e8 d7 61 94 ff call 0xff94620c
35: 48 89 1c 24 mov %rbx,(%rsp)
39: 4c 8b 2b mov (%rbx),%r13
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-04 17:43 UTC (permalink / raw)
To: Bernd Schubert
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <14222a33-62a3-4c8f-b86f-7c5ee47c9db7@bsbernd.com>
On Mon, May 04, 2026 at 05:41:38PM +0200, Bernd Schubert wrote:
>
>
> On 5/2/26 21:51, Bernd Schubert wrote:
> >
> >> Oh, that's concerning. Could you figure out exactly what it's
> >> complaining about and send that to me, please?
> >
> Hi Darrick,
>
> just pushed a new branch version that should avoid all chekpatch
> warnings (squash of yours and fix of one I had introduced).
Ok, thanks. I'll have a look, thanks.
> Please find attached all the CodeChecker warnings.
<nod> I'll try to eliminate as many of these as possible. I think the
complaints about "can be declared as pointer to const struct" are easily
amended.
The ones involving char **argv might be a little trickier though.
Anyway, I'll try to have something ready to send out before morning in
Europe, assuming that either you're at LSFMM or at least in a similar
timezone.
Also thanks for sending the tarball, it's useful (a) to know which
cppcheck complaints you want fixed, and (b) to compare against the
version on my system (Debian 13).
--D
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-04 15:41 UTC (permalink / raw)
To: Darrick J. Wong
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <757367d0-3a8b-4de8-aa86-f74f316b3445@bsbernd.com>
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
On 5/2/26 21:51, Bernd Schubert wrote:
>
>> Oh, that's concerning. Could you figure out exactly what it's
>> complaining about and send that to me, please?
>
Hi Darrick,
just pushed a new branch version that should avoid all chekpatch
warnings (squash of yours and fix of one I had introduced).
Please find attached all the CodeChecker warnings.
Thanks,
Bernd
[-- Attachment #2: codechecker.tar.gz --]
[-- Type: application/gzip, Size: 379241 bytes --]
^ permalink raw reply
* Re: [RFC] ext4: possible inconsistency in ext4_append() error path
From: Jan Kara @ 2026-05-03 17:23 UTC (permalink / raw)
To: Vineet Agarwal
Cc: tytso, linux-ext4, adilger.kernel, libaokun, jack, ojaswin,
ritesh.list, yi.zhang, linux-kernel
In-Reply-To: <20260501172506.563064-1-agarwal.vineet2006@gmail.com>
Hi!
On Fri 01-05-26 22:55:06, Vineet Agarwal wrote:
> While looking into ext4 directory operations, I noticed a possible
> inconsistency in the error handling of ext4_append().
>
> In ext4_append(), the inode size is updated before all failure points
> have been ruled out:
>
> bh = ext4_bread(handle, inode, *block, EXT4_GET_BLOCKS_CREATE);
> if (IS_ERR(bh))
> return bh;
>
> inode->i_size += inode->i_sb->s_blocksize;
> EXT4_I(inode)->i_disksize = inode->i_size;
>
> err = ext4_mark_inode_dirty(handle, inode);
> if (err)
> goto out;
>
> err = ext4_journal_get_write_access(handle, inode->i_sb, bh,
> EXT4_JTR_NONE);
> if (err)
> goto out;
>
> If either ext4_mark_inode_dirty() or
> ext4_journal_get_write_access() fails, the function returns an
> error but does not restore the original inode size.
>
> Callers of ext4_append() appear to treat it as an all-or-nothing
> operation:
>
> bh = ext4_append(handle, dir, &block);
> if (IS_ERR(bh))
> goto out;
>
> However, in the failure case, inode->i_size may already have been
> increased.
Right.
> One possible consequence is that subsequent checks relying on i_size,
> such as:
>
> if (block >= inode->i_size >> inode->i_blkbits)
>
> may allow a block index to pass bounds checks even though the append
> operation did not complete successfully.
>
> I understand that journaling may ensure on-disk consistency, but the
> in-memory inode state may still temporarily reflect a change that did
> not logically succeed.
>
> Is this behavior intentional, or should ext4_append() avoid updating
> i_size until after all failure points, or roll it back on error?
The thing is: If any of the above calls you mention fail, the filesystem
journal is aborted and the filesystem doesn't accept any more
modifications. So we are kind of sloppy with error recovery since it cannot
reach on-disk state. I'm not aware where the increased inode size on
failing ext4_append() would cause issues (besides further error complaints)
but if you find some such, yes, we can improve the error recovery path.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-02 19:51 UTC (permalink / raw)
To: Darrick J. Wong
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <20260502190543.GG3778109@frogsfrogsfrogs>
On 5/2/26 21:05, Darrick J. Wong wrote:
> On Sat, May 02, 2026 at 06:26:16PM +0200, Bernd Schubert wrote:
>>
>>
>> On 5/2/26 17:59, Bernd Schubert wrote:
>>>
>>>
>>> On 5/1/26 00:49, Darrick J. Wong wrote:
>>>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
>>>>> Hi Darrick,
>>>>>
>>>>> On 4/30/26 23:18, Darrick J. Wong wrote:
>>>>>> Hi Bernd,
>>>>>>
>>>>>> Please pull this branch with changes for libfuse.
>>>>>>
>>>>>> As usual, I did a test-merge with the main upstream branch as of a few
>>>>>> minutes ago, and didn't see any conflicts. Please let me know if you
>>>>>> encounter any problems.
>>>>>
>>>>> pushed to my github branch. BSD build fails with
>>>>>
>>>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
>>>>> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
>>>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
>>>>
>>>> Aha, that function got left out of the stub. :(
>>>>
>>>> Annoyingly, on Linux the build succeeds despite the missing symbol
>>>> when I tweak meson so that it doesn't build the service stuff. I would
>>>> have thought that --no-undefined would have done that, but alas.
>>>>
>>>> Sorry about that too. The following patch fixes it.
>>>>
>>>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
>>>> index d34df3891a6e31..231b98423df628 100644
>>>> --- i/lib/fuse_service_stub.c
>>>> +++ w/lib/fuse_service_stub.c
>>>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
>>>> int fuse_service_accept(struct fuse_service **sfp)
>>>> {
>>>> *sfp = NULL;
>>>> return 0;
>>>> }
>>>>
>>>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
>>>> +{
>>>> + return false;
>>>> +}
>>>> +
>>>> int fuse_service_append_args(struct fuse_service *sf,
>>>> struct fuse_args *existing_args)
>>>> {
>>>> return -EOPNOTSUPP;
>>>> }
>>>>
>>>>
>>>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
>>>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
>>>>>
>>>>>
>>>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
>>>>
>>>> Not sure why checkpatch fails, this is what I got (Debian 13):
>>>>
>>>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
>>>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
>>>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
>>>> total: 0 errors, 0 warnings, 3908 lines checked
>>>>
>>>> Your patch has no obvious style problems and is ready for submission.
>>>>
>>>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
>>>>
>>>> cppcheck had a few things to say, but none of it was about the changed
>>>> lines.
>>>>
>>>>> report is funny
>>>>>
>>>>>> int mount_service_main(int argc, char *argv[])
>>>>>> Warning
>>>>>> Poorly documented large function
>>>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
>>>>>> CodeQL
>>>>
>>>> Hrmm. I guess I'll have to figure out how to get those things running.
>>>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
>>>> it's not public library API) so I didn't comment them as intensely.
>>>> Would you like more?
>>>>
>>>>> I think I'm going to merge my sync fuse init series tomorrow.
>>>>
>>>> Yay!
>>>>
>>>>> Are you ok if skip posting another version of the series?
>>>>
>>>> ^ is there an "I" here? e.g. "...if I skip posting..."?
>>>>
>>>> /My/ normal practice (from xfs) was to repost the series as it was
>>>> merged, followed by an announcement. That way the mailing list is a
>>>> complete record of what was merged. However, very very few people
>>>> actually do that, even in the kernel.
>>>>
>>>> I'm ok with you not posting another version of the series.
>>>>
>>>>> Or do you prefer to review the recent changes and last piece I'm going
>>>>> to do tomorrow?
>>>>
>>>> Nah, just merge it. I'll look over the changes once it's in the branch
>>>> and if there's anything weird, you or I or anyone else can send patches.
>>>> As long as you're not planning to tag it as a release, nothing's set in
>>>> stone.
>>>>
>>>>> Basically my goal is to rebase your series against it immediately and
>>>>> to merge your series during the next few days.
>>>>
>>>> <nod> Let me know what you want changed, I'll be around since I am not
>>>> travelling anywhere for a couple of weeks. :)
>>>>
>>>> I can reflow changes into the patchset, or if you'd prefer, I can add
>>>> them as new patches that would go on the end of the series.
>>>>
>>>
>>> Hi Darrick,
>>>
>>> eventually merged my patches and made a quick rebase and conflict
>>> resolving with your branch. Github still reports plenty of issues ;)
>>>
>>> Could you fix all of the checkpatch isssues? This one shows plenty
>>> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
>>>
>>> bschubert2@imesrv6 libfuse.git>stg series
>>> + mount_service-add-systemd
>>> + mount_service-create-high
>>> + mount_service-use-the-new
>>> + mount_service-update-mtab
>>>> util-hoist-the-fuse.conf
>>> - util-fix-checkpatch-complaints
>>> - mount_service-enable
>>> - mount.fuse3-integrate-systemd
>>> - mount_service-allow
>>> - example-service_ll-create-a
>>> - example-service-create-a
>>> - nullfs-support-fuse-systemd
>>> - meson-show-feature-summary
>>> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
>>> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
>>> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
>>> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
>>> #61: FILE: util/fuser_conf.c:33:
>>> +int user_allow_other = 0;
>>>
>>> WARNING:LINE_SPACING: Missing a blank line after declarations
>>> #74: FILE: util/fuser_conf.c:46:
>>> + char *dest = buf;
>>> + while (1) {
>>>
>>> ...
>>>
>>> I don't have a strong opinion about these two above - feel
>>> free to disable them. However, in order to merge it, it would
>>> be good to run without any checkpatch report.
>>> And everything that cppcheck and gcc-checker reports, definitely
>>> need to be fixed.
>>
>> Basically
>>
>> cd <$FUSEDIR>
>> BUILDDIR="build-without-examples"
>> mkdir -p ${BUILDDIR}
>> meson setup ${BUILDDIR} -Dexamples=false
>> ninja -C ${BUILDDIR}
>> ./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}
>>
>> gcc reports are starting here
>>
>> bschubert2@imesrv6 libfuse.git>stg series
>> + mount_service-add-systemd
>> + mount_service-create-high
>> + mount_service-use-the-new
>> + mount_service-update-mtab
>> + util-hoist-the-fuse.conf
>> + util-fix-checkpatch-complaints
>> + mount_service-enable
>>> mount.fuse3-integrate-systemd
>>
>>
>> bschubert2@imesrv6 libfuse.git>git show |head -n5
>> commit f908bb1504eca167e156671dde957c2e7192b7d2
>> Author: Darrick J. Wong <djwong@kernel.org>
>> Date: Wed Mar 4 13:48:55 2026 -0800
>>
>> mount.fuse3: integrate systemd service startup
>>
>>
>> ---==== Severity Statistics ====----
>> ----------------------------
>> Severity | Number of reports
>> ----------------------------
>> MEDIUM | 1
>> ----------------------------
>> ----=================----
>>
>> ----==== Checker Statistics ====----
>> -----------------------------------------------------
>> Checker name | Severity | Number of reports
>> -----------------------------------------------------
>> gcc-deref-before-check | MEDIUM | 1
>
> Oh, that's concerning. Could you figure out exactly what it's
> complaining about and send that to me, please?
I'm afraid I don't manage anymore today. Still a couple of
other things to do (like changing laptop keyboard and packing
a few things, preparing bread for the oven).
It is really easy to run this yourself
cd <$FUSEDIR>
BUILDDIR="build-without-examples"
mkdir -p ${BUILDDIR}
meson setup ${BUILDDIR} -Dexamples=false
ninja -C ${BUILDDIR}
./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}
There is --gcc and --cppcheck
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-02 19:05 UTC (permalink / raw)
To: Bernd Schubert
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <1d2c00d0-255f-44cd-9757-d7418373cdcd@bsbernd.com>
On Sat, May 02, 2026 at 06:26:16PM +0200, Bernd Schubert wrote:
>
>
> On 5/2/26 17:59, Bernd Schubert wrote:
> >
> >
> > On 5/1/26 00:49, Darrick J. Wong wrote:
> >> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
> >>> Hi Darrick,
> >>>
> >>> On 4/30/26 23:18, Darrick J. Wong wrote:
> >>>> Hi Bernd,
> >>>>
> >>>> Please pull this branch with changes for libfuse.
> >>>>
> >>>> As usual, I did a test-merge with the main upstream branch as of a few
> >>>> minutes ago, and didn't see any conflicts. Please let me know if you
> >>>> encounter any problems.
> >>>
> >>> pushed to my github branch. BSD build fails with
> >>>
> >>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
> >>> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
> >>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
> >>
> >> Aha, that function got left out of the stub. :(
> >>
> >> Annoyingly, on Linux the build succeeds despite the missing symbol
> >> when I tweak meson so that it doesn't build the service stuff. I would
> >> have thought that --no-undefined would have done that, but alas.
> >>
> >> Sorry about that too. The following patch fixes it.
> >>
> >> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
> >> index d34df3891a6e31..231b98423df628 100644
> >> --- i/lib/fuse_service_stub.c
> >> +++ w/lib/fuse_service_stub.c
> >> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
> >> int fuse_service_accept(struct fuse_service **sfp)
> >> {
> >> *sfp = NULL;
> >> return 0;
> >> }
> >>
> >> +bool fuse_service_can_allow_other(struct fuse_service *sf)
> >> +{
> >> + return false;
> >> +}
> >> +
> >> int fuse_service_append_args(struct fuse_service *sf,
> >> struct fuse_args *existing_args)
> >> {
> >> return -EOPNOTSUPP;
> >> }
> >>
> >>
> >>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
> >>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
> >>>
> >>>
> >>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
> >>
> >> Not sure why checkpatch fails, this is what I got (Debian 13):
> >>
> >> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
> >> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
> >> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
> >> total: 0 errors, 0 warnings, 3908 lines checked
> >>
> >> Your patch has no obvious style problems and is ready for submission.
> >>
> >> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
> >>
> >> cppcheck had a few things to say, but none of it was about the changed
> >> lines.
> >>
> >>> report is funny
> >>>
> >>>> int mount_service_main(int argc, char *argv[])
> >>>> Warning
> >>>> Poorly documented large function
> >>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
> >>>> CodeQL
> >>
> >> Hrmm. I guess I'll have to figure out how to get those things running.
> >> That said, the stuff in mount_service.c is internal to libfuse (i.e.
> >> it's not public library API) so I didn't comment them as intensely.
> >> Would you like more?
> >>
> >>> I think I'm going to merge my sync fuse init series tomorrow.
> >>
> >> Yay!
> >>
> >>> Are you ok if skip posting another version of the series?
> >>
> >> ^ is there an "I" here? e.g. "...if I skip posting..."?
> >>
> >> /My/ normal practice (from xfs) was to repost the series as it was
> >> merged, followed by an announcement. That way the mailing list is a
> >> complete record of what was merged. However, very very few people
> >> actually do that, even in the kernel.
> >>
> >> I'm ok with you not posting another version of the series.
> >>
> >>> Or do you prefer to review the recent changes and last piece I'm going
> >>> to do tomorrow?
> >>
> >> Nah, just merge it. I'll look over the changes once it's in the branch
> >> and if there's anything weird, you or I or anyone else can send patches.
> >> As long as you're not planning to tag it as a release, nothing's set in
> >> stone.
> >>
> >>> Basically my goal is to rebase your series against it immediately and
> >>> to merge your series during the next few days.
> >>
> >> <nod> Let me know what you want changed, I'll be around since I am not
> >> travelling anywhere for a couple of weeks. :)
> >>
> >> I can reflow changes into the patchset, or if you'd prefer, I can add
> >> them as new patches that would go on the end of the series.
> >>
> >
> > Hi Darrick,
> >
> > eventually merged my patches and made a quick rebase and conflict
> > resolving with your branch. Github still reports plenty of issues ;)
> >
> > Could you fix all of the checkpatch isssues? This one shows plenty
> > "util: hoist the fuse.conf parsing and setuid mode enforcement code"
> >
> > bschubert2@imesrv6 libfuse.git>stg series
> > + mount_service-add-systemd
> > + mount_service-create-high
> > + mount_service-use-the-new
> > + mount_service-update-mtab
> >> util-hoist-the-fuse.conf
> > - util-fix-checkpatch-complaints
> > - mount_service-enable
> > - mount.fuse3-integrate-systemd
> > - mount_service-allow
> > - example-service_ll-create-a
> > - example-service-create-a
> > - nullfs-support-fuse-systemd
> > - meson-show-feature-summary
> > bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
> > No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
> > No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
> > ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
> > #61: FILE: util/fuser_conf.c:33:
> > +int user_allow_other = 0;
> >
> > WARNING:LINE_SPACING: Missing a blank line after declarations
> > #74: FILE: util/fuser_conf.c:46:
> > + char *dest = buf;
> > + while (1) {
> >
> > ...
> >
> > I don't have a strong opinion about these two above - feel
> > free to disable them. However, in order to merge it, it would
> > be good to run without any checkpatch report.
> > And everything that cppcheck and gcc-checker reports, definitely
> > need to be fixed.
>
> Basically
>
> cd <$FUSEDIR>
> BUILDDIR="build-without-examples"
> mkdir -p ${BUILDDIR}
> meson setup ${BUILDDIR} -Dexamples=false
> ninja -C ${BUILDDIR}
> ./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}
>
> gcc reports are starting here
>
> bschubert2@imesrv6 libfuse.git>stg series
> + mount_service-add-systemd
> + mount_service-create-high
> + mount_service-use-the-new
> + mount_service-update-mtab
> + util-hoist-the-fuse.conf
> + util-fix-checkpatch-complaints
> + mount_service-enable
> > mount.fuse3-integrate-systemd
>
>
> bschubert2@imesrv6 libfuse.git>git show |head -n5
> commit f908bb1504eca167e156671dde957c2e7192b7d2
> Author: Darrick J. Wong <djwong@kernel.org>
> Date: Wed Mar 4 13:48:55 2026 -0800
>
> mount.fuse3: integrate systemd service startup
>
>
> ---==== Severity Statistics ====----
> ----------------------------
> Severity | Number of reports
> ----------------------------
> MEDIUM | 1
> ----------------------------
> ----=================----
>
> ----==== Checker Statistics ====----
> -----------------------------------------------------
> Checker name | Severity | Number of reports
> -----------------------------------------------------
> gcc-deref-before-check | MEDIUM | 1
Oh, that's concerning. Could you figure out exactly what it's
complaining about and send that to me, please?
--D
> -----------------------------------------------------
> ----=================----
>
> ----==== File Statistics ====----
> --------------------------------
> File name | Number of reports
> --------------------------------
> mount.fuse.c | 1
> --------------------------------
> ----=================----
>
> ----======== Summary ========----
> ----------------------------------------------
> Number of processed analyzer result files | 45
> Number of analyzer reports | 1
> ----------------------------------------------
> ----=================----
>
> To view statistics in a browser run:
> > firefox /home/bschubert2/src/libfuse/libfuse.git/build-without-examples/codechecker-html/statistics.html
>
> To view the results in a browser run:
> > firefox /home/bschubert2/src/libfuse/libfuse.git/build-without-examples/codechecker-html/index.html
> [INFO 2026-05-02 18:25] - ----==== Summary ====----
> [INFO 2026-05-02 18:25] - Up-to-date analysis results
> [INFO 2026-05-02 18:25] - gcc: 37
> [INFO 2026-05-02 18:25] - Outdated analysis results
> [INFO 2026-05-02 18:25] - Failed to analyze
> [INFO 2026-05-02 18:25] - Missing analysis results
> [INFO 2026-05-02 18:25] - clangsa: 37
> [INFO 2026-05-02 18:25] - clang-tidy: 37
> [INFO 2026-05-02 18:25] - cppcheck: 37
> [INFO 2026-05-02 18:25] - infer: 37
> [INFO 2026-05-02 18:25] - Total analyzed compilation commands: 45
> [INFO 2026-05-02 18:25] - Total available compilation commands: 45
> [INFO 2026-05-02 18:25] - ----=================----
> bschubert2@imesrv6 libfuse.git>
>
>
>
>
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-02 18:57 UTC (permalink / raw)
To: Bernd Schubert
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <c88d39e4-0a67-4de6-9d7d-353f8c950c81@bsbernd.com>
On Sat, May 02, 2026 at 06:58:30PM +0200, Bernd Schubert wrote:
>
>
> On 5/2/26 18:30, Darrick J. Wong wrote:
> > On Sat, May 02, 2026 at 05:59:06PM +0200, Bernd Schubert wrote:
> >>
> >>
> >> On 5/1/26 00:49, Darrick J. Wong wrote:
> >>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
> >>>> Hi Darrick,
> >>>>
> >>>> On 4/30/26 23:18, Darrick J. Wong wrote:
> >>>>> Hi Bernd,
> >>>>>
> >>>>> Please pull this branch with changes for libfuse.
> >>>>>
> >>>>> As usual, I did a test-merge with the main upstream branch as of a few
> >>>>> minutes ago, and didn't see any conflicts. Please let me know if you
> >>>>> encounter any problems.
> >>>>
> >>>> pushed to my github branch. BSD build fails with
> >>>>
> >>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
> >>>> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
> >>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
> >>>
> >>> Aha, that function got left out of the stub. :(
> >>>
> >>> Annoyingly, on Linux the build succeeds despite the missing symbol
> >>> when I tweak meson so that it doesn't build the service stuff. I would
> >>> have thought that --no-undefined would have done that, but alas.
> >>>
> >>> Sorry about that too. The following patch fixes it.
> >>>
> >>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
> >>> index d34df3891a6e31..231b98423df628 100644
> >>> --- i/lib/fuse_service_stub.c
> >>> +++ w/lib/fuse_service_stub.c
> >>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
> >>> int fuse_service_accept(struct fuse_service **sfp)
> >>> {
> >>> *sfp = NULL;
> >>> return 0;
> >>> }
> >>>
> >>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
> >>> +{
> >>> + return false;
> >>> +}
> >>> +
> >>> int fuse_service_append_args(struct fuse_service *sf,
> >>> struct fuse_args *existing_args)
> >>> {
> >>> return -EOPNOTSUPP;
> >>> }
> >>>
> >>>
> >>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
> >>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
> >>>>
> >>>>
> >>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
> >>>
> >>> Not sure why checkpatch fails, this is what I got (Debian 13):
> >>>
> >>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
> >>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
> >>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
> >>> total: 0 errors, 0 warnings, 3908 lines checked
> >>>
> >>> Your patch has no obvious style problems and is ready for submission.
> >>>
> >>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
> >>>
> >>> cppcheck had a few things to say, but none of it was about the changed
> >>> lines.
> >>>
> >>>> report is funny
> >>>>
> >>>>> int mount_service_main(int argc, char *argv[])
> >>>>> Warning
> >>>>> Poorly documented large function
> >>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
> >>>>> CodeQL
> >>>
> >>> Hrmm. I guess I'll have to figure out how to get those things running.
> >>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
> >>> it's not public library API) so I didn't comment them as intensely.
> >>> Would you like more?
> >>>
> >>>> I think I'm going to merge my sync fuse init series tomorrow.
> >>>
> >>> Yay!
> >>>
> >>>> Are you ok if skip posting another version of the series?
> >>>
> >>> ^ is there an "I" here? e.g. "...if I skip posting..."?
> >>>
> >>> /My/ normal practice (from xfs) was to repost the series as it was
> >>> merged, followed by an announcement. That way the mailing list is a
> >>> complete record of what was merged. However, very very few people
> >>> actually do that, even in the kernel.
> >>>
> >>> I'm ok with you not posting another version of the series.
> >>>
> >>>> Or do you prefer to review the recent changes and last piece I'm going
> >>>> to do tomorrow?
> >>>
> >>> Nah, just merge it. I'll look over the changes once it's in the branch
> >>> and if there's anything weird, you or I or anyone else can send patches.
> >>> As long as you're not planning to tag it as a release, nothing's set in
> >>> stone.
> >>>
> >>>> Basically my goal is to rebase your series against it immediately and
> >>>> to merge your series during the next few days.
> >>>
> >>> <nod> Let me know what you want changed, I'll be around since I am not
> >>> travelling anywhere for a couple of weeks. :)
> >>>
> >>> I can reflow changes into the patchset, or if you'd prefer, I can add
> >>> them as new patches that would go on the end of the series.
> >>>
> >>
> >> Hi Darrick,
> >>
> >> eventually merged my patches and made a quick rebase and conflict
> >> resolving with your branch. Github still reports plenty of issues ;)
> >>
> >> Could you fix all of the checkpatch isssues? This one shows plenty
> >> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
> >>
> >> bschubert2@imesrv6 libfuse.git>stg series
> >> + mount_service-add-systemd
> >> + mount_service-create-high
> >> + mount_service-use-the-new
> >> + mount_service-update-mtab
> >>> util-hoist-the-fuse.conf
> >> - util-fix-checkpatch-complaints
> >> - mount_service-enable
> >> - mount.fuse3-integrate-systemd
> >> - mount_service-allow
> >> - example-service_ll-create-a
> >> - example-service-create-a
> >> - nullfs-support-fuse-systemd
> >> - meson-show-feature-summary
> >> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
> >> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
> >> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
> >> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
> >> #61: FILE: util/fuser_conf.c:33:
> >> +int user_allow_other = 0;
> >>
> >> WARNING:LINE_SPACING: Missing a blank line after declarations
> >> #74: FILE: util/fuser_conf.c:46:
> >> + char *dest = buf;
> >> + while (1) {
> >
> > Oh! The checkpatch fixes are all in the next commit
> > "util-fix-checkpatch-complaints". I kept the checkpatch fixes as a
> > separate commit so that the hoist change can be inspected more easily.
>
> That is not going to work, the script it set up to check every commit in
> the PR branch.
In that case, please just squash them together with:
$ stg squash -n util-hoist-the-fuse.conf util-hoist-the-fuse.conf util-fix-checkpatch-complaints
> >
> > (XFS practice is to have separate patches for moving the code and
> > cleaning it up)
> >
> >> ...
> >>
> >> I don't have a strong opinion about these two above - feel
> >> free to disable them. However, in order to merge it, it would
> >> be good to run without any checkpatch report.
> >> And everything that cppcheck and gcc-checker reports, definitely
> >> need to be fixed.
> >
> > Hrm, should I try to fix the things that cppcheck complains about in
> > HEAD? There's an awful lot of them...
> >
> > (oh, I see you pushed to master, I'll go rebase now)
>
> I had already rebased:
>
> https://github.com/bsbernd/libfuse/tree/fuse-service-container
Oh! Ok, I'll rebase against that, then.
--D
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-02 16:58 UTC (permalink / raw)
To: Darrick J. Wong
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <20260502163027.GO7765@frogsfrogsfrogs>
On 5/2/26 18:30, Darrick J. Wong wrote:
> On Sat, May 02, 2026 at 05:59:06PM +0200, Bernd Schubert wrote:
>>
>>
>> On 5/1/26 00:49, Darrick J. Wong wrote:
>>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
>>>> Hi Darrick,
>>>>
>>>> On 4/30/26 23:18, Darrick J. Wong wrote:
>>>>> Hi Bernd,
>>>>>
>>>>> Please pull this branch with changes for libfuse.
>>>>>
>>>>> As usual, I did a test-merge with the main upstream branch as of a few
>>>>> minutes ago, and didn't see any conflicts. Please let me know if you
>>>>> encounter any problems.
>>>>
>>>> pushed to my github branch. BSD build fails with
>>>>
>>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
>>>> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
>>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
>>>
>>> Aha, that function got left out of the stub. :(
>>>
>>> Annoyingly, on Linux the build succeeds despite the missing symbol
>>> when I tweak meson so that it doesn't build the service stuff. I would
>>> have thought that --no-undefined would have done that, but alas.
>>>
>>> Sorry about that too. The following patch fixes it.
>>>
>>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
>>> index d34df3891a6e31..231b98423df628 100644
>>> --- i/lib/fuse_service_stub.c
>>> +++ w/lib/fuse_service_stub.c
>>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
>>> int fuse_service_accept(struct fuse_service **sfp)
>>> {
>>> *sfp = NULL;
>>> return 0;
>>> }
>>>
>>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
>>> +{
>>> + return false;
>>> +}
>>> +
>>> int fuse_service_append_args(struct fuse_service *sf,
>>> struct fuse_args *existing_args)
>>> {
>>> return -EOPNOTSUPP;
>>> }
>>>
>>>
>>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
>>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
>>>>
>>>>
>>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
>>>
>>> Not sure why checkpatch fails, this is what I got (Debian 13):
>>>
>>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
>>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
>>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
>>> total: 0 errors, 0 warnings, 3908 lines checked
>>>
>>> Your patch has no obvious style problems and is ready for submission.
>>>
>>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
>>>
>>> cppcheck had a few things to say, but none of it was about the changed
>>> lines.
>>>
>>>> report is funny
>>>>
>>>>> int mount_service_main(int argc, char *argv[])
>>>>> Warning
>>>>> Poorly documented large function
>>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
>>>>> CodeQL
>>>
>>> Hrmm. I guess I'll have to figure out how to get those things running.
>>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
>>> it's not public library API) so I didn't comment them as intensely.
>>> Would you like more?
>>>
>>>> I think I'm going to merge my sync fuse init series tomorrow.
>>>
>>> Yay!
>>>
>>>> Are you ok if skip posting another version of the series?
>>>
>>> ^ is there an "I" here? e.g. "...if I skip posting..."?
>>>
>>> /My/ normal practice (from xfs) was to repost the series as it was
>>> merged, followed by an announcement. That way the mailing list is a
>>> complete record of what was merged. However, very very few people
>>> actually do that, even in the kernel.
>>>
>>> I'm ok with you not posting another version of the series.
>>>
>>>> Or do you prefer to review the recent changes and last piece I'm going
>>>> to do tomorrow?
>>>
>>> Nah, just merge it. I'll look over the changes once it's in the branch
>>> and if there's anything weird, you or I or anyone else can send patches.
>>> As long as you're not planning to tag it as a release, nothing's set in
>>> stone.
>>>
>>>> Basically my goal is to rebase your series against it immediately and
>>>> to merge your series during the next few days.
>>>
>>> <nod> Let me know what you want changed, I'll be around since I am not
>>> travelling anywhere for a couple of weeks. :)
>>>
>>> I can reflow changes into the patchset, or if you'd prefer, I can add
>>> them as new patches that would go on the end of the series.
>>>
>>
>> Hi Darrick,
>>
>> eventually merged my patches and made a quick rebase and conflict
>> resolving with your branch. Github still reports plenty of issues ;)
>>
>> Could you fix all of the checkpatch isssues? This one shows plenty
>> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
>>
>> bschubert2@imesrv6 libfuse.git>stg series
>> + mount_service-add-systemd
>> + mount_service-create-high
>> + mount_service-use-the-new
>> + mount_service-update-mtab
>>> util-hoist-the-fuse.conf
>> - util-fix-checkpatch-complaints
>> - mount_service-enable
>> - mount.fuse3-integrate-systemd
>> - mount_service-allow
>> - example-service_ll-create-a
>> - example-service-create-a
>> - nullfs-support-fuse-systemd
>> - meson-show-feature-summary
>> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
>> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
>> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
>> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
>> #61: FILE: util/fuser_conf.c:33:
>> +int user_allow_other = 0;
>>
>> WARNING:LINE_SPACING: Missing a blank line after declarations
>> #74: FILE: util/fuser_conf.c:46:
>> + char *dest = buf;
>> + while (1) {
>
> Oh! The checkpatch fixes are all in the next commit
> "util-fix-checkpatch-complaints". I kept the checkpatch fixes as a
> separate commit so that the hoist change can be inspected more easily.
That is not going to work, the script it set up to check every commit in
the PR branch.
>
> (XFS practice is to have separate patches for moving the code and
> cleaning it up)
>
>> ...
>>
>> I don't have a strong opinion about these two above - feel
>> free to disable them. However, in order to merge it, it would
>> be good to run without any checkpatch report.
>> And everything that cppcheck and gcc-checker reports, definitely
>> need to be fixed.
>
> Hrm, should I try to fix the things that cppcheck complains about in
> HEAD? There's an awful lot of them...
>
> (oh, I see you pushed to master, I'll go rebase now)
I had already rebased:
https://github.com/bsbernd/libfuse/tree/fuse-service-container
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-02 16:30 UTC (permalink / raw)
To: Bernd Schubert
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <2f2ba053-53a7-43e5-969a-32d185e9c7b7@bsbernd.com>
On Sat, May 02, 2026 at 05:59:06PM +0200, Bernd Schubert wrote:
>
>
> On 5/1/26 00:49, Darrick J. Wong wrote:
> > On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
> >> Hi Darrick,
> >>
> >> On 4/30/26 23:18, Darrick J. Wong wrote:
> >>> Hi Bernd,
> >>>
> >>> Please pull this branch with changes for libfuse.
> >>>
> >>> As usual, I did a test-merge with the main upstream branch as of a few
> >>> minutes ago, and didn't see any conflicts. Please let me know if you
> >>> encounter any problems.
> >>
> >> pushed to my github branch. BSD build fails with
> >>
> >> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
> >> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
> >> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
> >
> > Aha, that function got left out of the stub. :(
> >
> > Annoyingly, on Linux the build succeeds despite the missing symbol
> > when I tweak meson so that it doesn't build the service stuff. I would
> > have thought that --no-undefined would have done that, but alas.
> >
> > Sorry about that too. The following patch fixes it.
> >
> > diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
> > index d34df3891a6e31..231b98423df628 100644
> > --- i/lib/fuse_service_stub.c
> > +++ w/lib/fuse_service_stub.c
> > @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
> > int fuse_service_accept(struct fuse_service **sfp)
> > {
> > *sfp = NULL;
> > return 0;
> > }
> >
> > +bool fuse_service_can_allow_other(struct fuse_service *sf)
> > +{
> > + return false;
> > +}
> > +
> > int fuse_service_append_args(struct fuse_service *sf,
> > struct fuse_args *existing_args)
> > {
> > return -EOPNOTSUPP;
> > }
> >
> >
> >> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
> >> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
> >>
> >>
> >> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
> >
> > Not sure why checkpatch fails, this is what I got (Debian 13):
> >
> > $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
> > No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
> > No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
> > total: 0 errors, 0 warnings, 3908 lines checked
> >
> > Your patch has no obvious style problems and is ready for submission.
> >
> > NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
> >
> > cppcheck had a few things to say, but none of it was about the changed
> > lines.
> >
> >> report is funny
> >>
> >>> int mount_service_main(int argc, char *argv[])
> >>> Warning
> >>> Poorly documented large function
> >>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
> >>> CodeQL
> >
> > Hrmm. I guess I'll have to figure out how to get those things running.
> > That said, the stuff in mount_service.c is internal to libfuse (i.e.
> > it's not public library API) so I didn't comment them as intensely.
> > Would you like more?
> >
> >> I think I'm going to merge my sync fuse init series tomorrow.
> >
> > Yay!
> >
> >> Are you ok if skip posting another version of the series?
> >
> > ^ is there an "I" here? e.g. "...if I skip posting..."?
> >
> > /My/ normal practice (from xfs) was to repost the series as it was
> > merged, followed by an announcement. That way the mailing list is a
> > complete record of what was merged. However, very very few people
> > actually do that, even in the kernel.
> >
> > I'm ok with you not posting another version of the series.
> >
> >> Or do you prefer to review the recent changes and last piece I'm going
> >> to do tomorrow?
> >
> > Nah, just merge it. I'll look over the changes once it's in the branch
> > and if there's anything weird, you or I or anyone else can send patches.
> > As long as you're not planning to tag it as a release, nothing's set in
> > stone.
> >
> >> Basically my goal is to rebase your series against it immediately and
> >> to merge your series during the next few days.
> >
> > <nod> Let me know what you want changed, I'll be around since I am not
> > travelling anywhere for a couple of weeks. :)
> >
> > I can reflow changes into the patchset, or if you'd prefer, I can add
> > them as new patches that would go on the end of the series.
> >
>
> Hi Darrick,
>
> eventually merged my patches and made a quick rebase and conflict
> resolving with your branch. Github still reports plenty of issues ;)
>
> Could you fix all of the checkpatch isssues? This one shows plenty
> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
>
> bschubert2@imesrv6 libfuse.git>stg series
> + mount_service-add-systemd
> + mount_service-create-high
> + mount_service-use-the-new
> + mount_service-update-mtab
> > util-hoist-the-fuse.conf
> - util-fix-checkpatch-complaints
> - mount_service-enable
> - mount.fuse3-integrate-systemd
> - mount_service-allow
> - example-service_ll-create-a
> - example-service-create-a
> - nullfs-support-fuse-systemd
> - meson-show-feature-summary
> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
> #61: FILE: util/fuser_conf.c:33:
> +int user_allow_other = 0;
>
> WARNING:LINE_SPACING: Missing a blank line after declarations
> #74: FILE: util/fuser_conf.c:46:
> + char *dest = buf;
> + while (1) {
Oh! The checkpatch fixes are all in the next commit
"util-fix-checkpatch-complaints". I kept the checkpatch fixes as a
separate commit so that the hoist change can be inspected more easily.
(XFS practice is to have separate patches for moving the code and
cleaning it up)
> ...
>
> I don't have a strong opinion about these two above - feel
> free to disable them. However, in order to merge it, it would
> be good to run without any checkpatch report.
> And everything that cppcheck and gcc-checker reports, definitely
> need to be fixed.
Hrm, should I try to fix the things that cppcheck complains about in
HEAD? There's an awful lot of them...
(oh, I see you pushed to master, I'll go rebase now)
--D
Checking build-aarch64/meson-private/sanitycheckc.c ...
Checking build-aarch64/meson-private/sanitycheckc.c: FUSE_USE_VERSION=319...
1/75 files checked 0% done
Checking build-aarch64/fuse_config.h ...
Checking build-aarch64/fuse_config.h: FUSE_USE_VERSION=319...
2/75 files checked 0% done
Checking build-aarch64/libfuse_config.h ...
Checking build-aarch64/libfuse_config.h: FUSE_USE_VERSION=319...
3/75 files checked 0% done
Checking example/cuse.c ...
Checking example/cuse.c: FUSE_USE_VERSION=319...
example/cuse.c:75:18: portability: 'new_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
memset(new_buf + cusexmp_size, 0, new_size - cusexmp_size);
^
example/cuse.c:113:34: portability: 'cusexmp_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
fuse_reply_buf(req, cusexmp_buf + off, size);
^
example/cuse.c:126:21: portability: 'cusexmp_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
memcpy(cusexmp_buf + off, buf, size);
^
example/cuse.c:145:9: portability: 'in_buf' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
in_buf += sizeof(*arg);
^
example/cuse.c:150:8: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
addr + offsetof(struct fioc_rw_arg, prev_size);
^
example/cuse.c:154:8: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
addr + offsetof(struct fioc_rw_arg, new_size);
^
example/cuse.c:191:33: portability: 'cusexmp_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
iov[2].iov_base = cusexmp_buf + off;
^
example/cuse.c:200:22: portability: 'cusexmp_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
memcpy(cusexmp_buf + arg->offset, in_buf, in_bufsz);
^
Checking example/cuse.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/cuse.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/cuse.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
4/75 files checked 0% done
Checking example/cuse_client.c ...
Checking example/cuse_client.c: FUSE_USE_VERSION=319...
5/75 files checked 1% done
Checking example/hello.c ...
Checking example/hello.c: FUSE_USE_VERSION=319...
Checking example/hello.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/hello.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/hello.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
6/75 files checked 1% done
Checking example/hello_ll_uds.c ...
Checking example/hello_ll_uds.c: FUSE_USE_VERSION=319...
example/hello_ll_uds.c:212:3: error: Resource leak: sfd [resourceLeak]
return -1;
^
example/hello_ll_uds.c:216:3: error: Resource leak: sfd [resourceLeak]
return -1;
^
example/hello_ll_uds.c:223:3: error: Resource leak: sfd [resourceLeak]
return -1;
^
example/hello_ll_uds.c:227:2: error: Resource leak: sfd [resourceLeak]
return cfd;
^
Checking example/hello_ll_uds.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/hello_ll_uds.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/hello_ll_uds.c: FUSE_USE_VERSION=319;__KERNEL__...
Checking example/hello_ll_uds.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
7/75 files checked 2% done
Checking example/invalidate_path.c ...
Checking example/invalidate_path.c: FUSE_USE_VERSION=319...
example/invalidate_path.c:169:8: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
now = localtime(&t);
^
example/invalidate_path.c:166:13: style: Variable 'now' can be declared as pointer to const [constVariablePointer]
struct tm *now;
^
Checking example/invalidate_path.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/invalidate_path.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/invalidate_path.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
8/75 files checked 3% done
Checking example/ioctl.c ...
Checking example/ioctl.c: FUSE_USE_VERSION=319...
example/ioctl.c:60:18: portability: 'new_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
memset(new_buf + fioc_size, 0, new_size - fioc_size);
^
example/ioctl.c:126:23: portability: 'fioc_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
memcpy(buf, fioc_buf + offset, size);
^
example/ioctl.c:147:18: portability: 'fioc_buf' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
memcpy(fioc_buf + offset, buf, size);
^
Checking example/ioctl.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/ioctl.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/ioctl.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
9/75 files checked 3% done
Checking example/ioctl.h ...
Checking example/ioctl.h: FUSE_USE_VERSION=319...
10/75 files checked 3% done
Checking example/ioctl_client.c ...
Checking example/ioctl_client.c: FUSE_USE_VERSION=319...
11/75 files checked 4% done
Checking example/notify_inval_entry.c ...
Checking example/notify_inval_entry.c: FUSE_USE_VERSION=319...
example/notify_inval_entry.c:264:11: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
now = localtime(&t);
^
example/notify_inval_entry.c:141:34: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck]
stbuf->st_mode = S_IFREG | 0000;
^
example/notify_inval_entry.c:274:11: style: The scope of the variable 'old_name' can be reduced. [variableScope]
char *old_name;
^
example/notify_inval_entry.c:260:16: style: Variable 'now' can be declared as pointer to const [constVariablePointer]
struct tm *now;
^
Checking example/notify_inval_entry.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/notify_inval_entry.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/notify_inval_entry.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
12/75 files checked 5% done
Checking example/notify_inval_inode.c ...
Checking example/notify_inval_inode.c: FUSE_USE_VERSION=319...
example/notify_inval_inode.c:274:11: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
now = localtime(&t);
^
example/notify_inval_inode.c:271:16: style: Variable 'now' can be declared as pointer to const [constVariablePointer]
struct tm *now;
^
Checking example/notify_inval_inode.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/notify_inval_inode.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/notify_inval_inode.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
13/75 files checked 6% done
Checking example/notify_store_retrieve.c ...
Checking example/notify_store_retrieve.c: FUSE_USE_VERSION=319...
example/notify_store_retrieve.c:329:11: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
now = localtime(&t);
^
example/notify_store_retrieve.c:326:16: style: Variable 'now' can be declared as pointer to const [constVariablePointer]
struct tm *now;
^
example/notify_store_retrieve.c:297:20: error: Uninitialized variable: buf [uninitvar]
assert(strncmp(buf, expected, ret) == 0);
^
Checking example/notify_store_retrieve.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/notify_store_retrieve.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/notify_store_retrieve.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
14/75 files checked 7% done
Checking example/passthrough.c ...
Checking example/passthrough.c: FUSE_USE_VERSION=319...
example/passthrough.c:134:15: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
while ((de = readdir(dp)) != NULL) {
^
example/passthrough_helpers.h:119:2: error: Returning/dereferencing 'res' after it is deallocated / released [deallocret]
return res;
^
example/passthrough_helpers.h:82:10: note: Returning/dereferencing 'res' after it is deallocated / released
res = close(res);
^
example/passthrough_helpers.h:119:2: note: Returning/dereferencing 'res' after it is deallocated / released
return res;
^
Checking example/passthrough.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/passthrough.c: FUSE_USE_VERSION=319;HAVE_COPY_FILE_RANGE...
Checking example/passthrough.c: FUSE_USE_VERSION=319;HAVE_FSPACECTL...
Checking example/passthrough.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/passthrough.c: FUSE_USE_VERSION=319;HAVE_SETXATTR...
Checking example/passthrough.c: FUSE_USE_VERSION=319;HAVE_STATX...
Checking example/passthrough.c: FUSE_USE_VERSION=319;HAVE_UTIMENSAT...
Checking example/passthrough.c: FUSE_USE_VERSION=319;__FreeBSD__...
Checking example/passthrough.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
Checking example/passthrough.c: FUSE_USE_VERSION=319;linux...
15/75 files checked 8% done
Checking example/passthrough_fh.c ...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319...
example/passthrough_fh.c:175:15: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
d->entry = readdir(d->dp);
^
example/passthrough_fh.c:143:2: error: Resource leak: d.dp [resourceLeak]
return 0;
^
example/passthrough_fh.c:128:6: style: The scope of the variable 'res' can be reduced. [variableScope]
int res;
^
example/passthrough_fh.c:146:64: style: Parameter 'fi' can be declared as pointer to const [constParameterPointer]
static inline struct xmp_dirp *get_dirp(struct fuse_file_info *fi)
^
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_COPY_FILE_RANGE...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_FDATASYNC...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_FSPACECTL...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_FSTATAT...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_LIBULOCKMGR...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_SETXATTR...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_STATX...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;HAVE_UTIMENSAT...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;__FreeBSD__...
Checking example/passthrough_fh.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
16/75 files checked 10% done
Checking example/passthrough_helpers.h ...
Checking example/passthrough_helpers.h: FUSE_USE_VERSION=319...
Checking example/passthrough_helpers.h: FUSE_USE_VERSION=319;HAVE_FALLOCATE...
Checking example/passthrough_helpers.h: FUSE_USE_VERSION=319;HAVE_FSPACECTL...
Checking example/passthrough_helpers.h: FUSE_USE_VERSION=319;HAVE_POSIX_FALLOCATE...
Checking example/passthrough_helpers.h: FUSE_USE_VERSION=319;__FreeBSD__...
17/75 files checked 10% done
Checking example/passthrough_ll.c ...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319...
example/passthrough_ll.c:705:15: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
d->entry = readdir(d->dp);
^
example/passthrough_ll.c:656:2: error: Resource leak: d.dp [resourceLeak]
return;
^
example/passthrough_ll.c:167:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = (struct lo_data *)userdata;
^
example/passthrough_ll.c:204:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = lo_data(req);
^
example/passthrough_ll.c:221:19: style: Variable 'inode' can be declared as pointer to const [constVariablePointer]
struct lo_inode *inode = lo_inode(req, ino);
^
example/passthrough_ll.c:291:66: style: Parameter 'st' can be declared as pointer to const [constParameterPointer]
static struct lo_inode *lo_find(struct lo_data *lo, struct stat *st)
^
example/passthrough_ll.c:425:19: style: Variable 'dir' can be declared as pointer to const [constVariablePointer]
struct lo_inode *dir = lo_inode(req, parent);
^
example/passthrough_ll.c:631:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = lo_data(req);
^
example/passthrough_ll.c:793:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = lo_data(req);
^
example/passthrough_ll.c:828:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = lo_data(req);
^
example/passthrough_ll.c:876:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = lo_data(req);
^
example/passthrough_ll.c:1029:19: style: Variable 'inode' can be declared as pointer to const [constVariablePointer]
struct lo_inode *inode = lo_inode(req, ino);
^
example/passthrough_ll.c:1079:19: style: Variable 'inode' can be declared as pointer to const [constVariablePointer]
struct lo_inode *inode = lo_inode(req, ino);
^
example/passthrough_ll.c:1129:19: style: Variable 'inode' can be declared as pointer to const [constVariablePointer]
struct lo_inode *inode = lo_inode(req, ino);
^
example/passthrough_ll.c:1154:19: style: Variable 'inode' can be declared as pointer to const [constVariablePointer]
struct lo_inode *inode = lo_inode(req, ino);
^
example/passthrough_ll.c:382:9: style: Variable 'newfd' is assigned a value that is never used. [unreadVariable]
newfd = -1;
^
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;HAVE_COPY_FILE_RANGE...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;HAVE_FSPACECTL...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
example/passthrough_ll.c:1220:18: style: Variable 'lo' can be declared as pointer to const [constVariablePointer]
struct lo_data *lo = lo_data(req);
^
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;HAVE_STATX...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;__FreeBSD__...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;__GNUC__...
Checking example/passthrough_ll.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
18/75 files checked 14% done
Checking example/poll.c ...
Checking example/poll.c: FUSE_USE_VERSION=319...
Checking example/poll.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/poll.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/poll.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
19/75 files checked 14% done
Checking example/poll_client.c ...
Checking example/poll_client.c: FUSE_USE_VERSION=319...
example/poll_client.c:43:8: style: Variable 'name' can be declared as const array [constVariable]
char name[] = { hex_map[i], '\0' };
^
20/75 files checked 14% done
Checking example/ioctl_ll.c ...
Checking example/ioctl_ll.c: FUSE_USE_VERSION=319...
Checking example/ioctl_ll.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/ioctl_ll.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/ioctl_ll.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
21/75 files checked 16% done
Checking example/ioctl_ll_client.c ...
Checking example/ioctl_ll_client.c: FUSE_USE_VERSION=319...
22/75 files checked 16% done
Checking example/notify_prune.c ...
Checking example/notify_prune.c: FUSE_USE_VERSION=319...
example/notify_prune.c:108:8: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
now = localtime(&t);
^
example/notify_prune.c:105:13: style: Variable 'now' can be declared as pointer to const [constVariablePointer]
struct tm *now;
^
Checking example/notify_prune.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/notify_prune.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/notify_prune.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
23/75 files checked 17% done
Checking example/hello_ll.c ...
Checking example/hello_ll.c: FUSE_USE_VERSION=319...
Checking example/hello_ll.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/hello_ll.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/hello_ll.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
24/75 files checked 18% done
Checking example/null.c ...
Checking example/null.c: FUSE_USE_VERSION=319...
Checking example/null.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking example/null.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/null.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
25/75 files checked 18% done
Checking example/printcap.c ...
Checking example/printcap.c: FUSE_USE_VERSION=319...
example/printcap.c:88:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
printf("Protocol version: %d.%d\n", conn->proto_major,
^
example/printcap.c:88:2: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
printf("Protocol version: %d.%d\n", conn->proto_major,
^
example/printcap.c:108:3: error: Memory leak: mountpoint [memleak]
return 1;
^
example/printcap.c:106:13: warning: If memory allocation fails, then there is a possible null pointer dereference: mountpoint [nullPointerOutOfMemory]
if(mkdtemp(mountpoint) == NULL) {
^
example/printcap.c:105:21: note: Assuming allocation function fails
mountpoint = strdup("/tmp/fuse_printcap_XXXXXX");
^
example/printcap.c:105:21: note: Assignment 'mountpoint=strdup("/tmp/fuse_printcap_XXXXXX")', assigned value is 0
mountpoint = strdup("/tmp/fuse_printcap_XXXXXX");
^
example/printcap.c:106:13: note: Null pointer dereference
if(mkdtemp(mountpoint) == NULL) {
^
example/printcap.c:74:55: style: Parameter 'conn' can be declared as pointer to const [constParameterPointer]
static void print_capabilities(struct fuse_conn_info *conn)
^
Checking example/printcap.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking example/printcap.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking example/printcap.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
26/75 files checked 18% done
Checking include/cuse_lowlevel.h ...
Checking include/cuse_lowlevel.h: FUSE_USE_VERSION=319...
Checking include/cuse_lowlevel.h: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking include/cuse_lowlevel.h: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking include/cuse_lowlevel.h: FUSE_USE_VERSION=319;__STDC_VERSION__...
27/75 files checked 19% done
Checking include/fuse_log.h ...
Checking include/fuse_log.h: FUSE_USE_VERSION=319...
28/75 files checked 19% done
Checking include/fuse_mount_compat.h ...
Checking include/fuse_mount_compat.h: FUSE_USE_VERSION=319...
29/75 files checked 19% done
Checking include/fuse_opt.h ...
Checking include/fuse_opt.h: FUSE_USE_VERSION=319...
30/75 files checked 20% done
Checking include/fuse.h ...
Checking include/fuse.h: FUSE_USE_VERSION=319...
Checking include/fuse.h: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking include/fuse.h: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking include/fuse.h: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking include/fuse.h: FUSE_USE_VERSION=319;LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS...
Checking include/fuse.h: FUSE_USE_VERSION=319;__STDC_VERSION__...
31/75 files checked 25% done
Checking include/fuse_common.h ...
Checking include/fuse_common.h: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
32/75 files checked 29% done
Checking include/fuse_kernel.h ...
Checking include/fuse_kernel.h: FUSE_USE_VERSION=319...
Checking include/fuse_kernel.h: FUSE_USE_VERSION=319;__KERNEL__...
33/75 files checked 32% done
Checking include/fuse_lowlevel.h ...
Checking include/fuse_lowlevel.h: FUSE_USE_VERSION=319...
Checking include/fuse_lowlevel.h: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking include/fuse_lowlevel.h: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking include/fuse_lowlevel.h: FUSE_USE_VERSION=319;LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS...
Checking include/fuse_lowlevel.h: FUSE_USE_VERSION=319;__STDC_VERSION__...
34/75 files checked 41% done
Checking lib/modules/iconv.c ...
Checking lib/modules/iconv.c: FUSE_USE_VERSION=319...
lib/modules/iconv.c:673:3: warning: If memory allocation fails, then there is a possible null pointer dereference: charmap [nullPointerOutOfMemory]
charmap);
^
lib/modules/iconv.c:664:18: note: Assuming allocation function fails
charmap = strdup(nl_langinfo(CODESET));
^
lib/modules/iconv.c:664:18: note: Assignment 'charmap=strdup(nl_langinfo(CODESET))', assigned value is 0
charmap = strdup(nl_langinfo(CODESET));
^
lib/modules/iconv.c:673:3: note: Null pointer dereference
charmap);
^
Checking lib/modules/iconv.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking lib/modules/iconv.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/modules/iconv.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking lib/modules/iconv.c: FUSE_USE_VERSION=319;HAVE_STATX...
Checking lib/modules/iconv.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
35/75 files checked 42% done
Checking lib/modules/subdir.c ...
Checking lib/modules/subdir.c: FUSE_USE_VERSION=319...
lib/modules/subdir.c:104:46: style: Parameter 'd' can be declared as pointer to const [constParameterPointer]
static void transform_symlink(struct subdir *d, const char *path,
^
Checking lib/modules/subdir.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking lib/modules/subdir.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/modules/subdir.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking lib/modules/subdir.c: FUSE_USE_VERSION=319;HAVE_STATX...
Checking lib/modules/subdir.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
36/75 files checked 44% done
Checking lib/buffer.c ...
Checking lib/buffer.c: FUSE_USE_VERSION=319...
Checking lib/buffer.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/buffer.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/buffer.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/buffer.c: FUSE_USE_VERSION=319;HAVE_SPLICE;FUSE_USE_VERSION...
Checking lib/buffer.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
37/75 files checked 45% done
Checking lib/compat.c ...
Checking lib/compat.c: FUSE_USE_VERSION=319...
Checking lib/compat.c: FUSE_USE_VERSION=319;LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS...
Checking lib/compat.c: FUSE_USE_VERSION=319;LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS;fuse_parse_cmdline...
38/75 files checked 45% done
Checking lib/cuse_lowlevel.c ...
Checking lib/cuse_lowlevel.c: FUSE_USE_VERSION=319...
Checking lib/cuse_lowlevel.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking lib/cuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking lib/cuse_lowlevel.c: FUSE_USE_VERSION=319;__KERNEL__...
Checking lib/cuse_lowlevel.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
39/75 files checked 46% done
Checking lib/fuse_log.c ...
Checking lib/fuse_log.c: FUSE_USE_VERSION=319...
40/75 files checked 46% done
Checking lib/fuse_loop.c ...
Checking lib/fuse_loop.c: FUSE_USE_VERSION=319...
Checking lib/fuse_loop.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_loop.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_loop.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_loop.c: FUSE_USE_VERSION=319;__KERNEL__;FUSE_USE_VERSION...
Checking lib/fuse_loop.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
41/75 files checked 46% done
Checking lib/fuse_loop_mt.c ...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;__KERNEL__;FUSE_USE_VERSION...
Checking lib/fuse_loop_mt.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
42/75 files checked 47% done
Checking lib/fuse_misc.h ...
Checking lib/fuse_misc.h: FUSE_USE_VERSION=319...
Checking lib/fuse_misc.h: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIM...
Checking lib/fuse_misc.h: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/fuse_misc.h: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE;LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS...
Checking lib/fuse_misc.h: FUSE_USE_VERSION=319;LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS...
43/75 files checked 48% done
Checking lib/fuse_opt.c ...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/fuse_opt.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
44/75 files checked 48% done
Checking lib/fuse_signals.c ...
Checking lib/fuse_signals.c: FUSE_USE_VERSION=319...
Checking lib/fuse_signals.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_signals.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_signals.c: FUSE_USE_VERSION=319;HAVE_BACKTRACE;FUSE_USE_VERSION...
Checking lib/fuse_signals.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_signals.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
45/75 files checked 49% done
Checking lib/fuse_uring_i.h ...
Checking lib/fuse_uring_i.h: FUSE_USE_VERSION=319...
Checking lib/fuse_uring_i.h: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_uring_i.h: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_uring_i.h: FUSE_USE_VERSION=319;HAVE_URING;FUSE_USE_VERSION...
Checking lib/fuse_uring_i.h: FUSE_USE_VERSION=319;__KERNEL__;FUSE_USE_VERSION...
Checking lib/fuse_uring_i.h: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
46/75 files checked 49% done
Checking lib/mount_bsd.c ...
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319...
lib/mount_bsd.c:190:8: style: The scope of the variable 'ret' can be reduced. [variableScope]
int ret = -1;
^
lib/mount_bsd.c:138:16: style: Variable 'dev' can be declared as pointer to const [constVariablePointer]
char *fdnam, *dev;
^
lib/mount_bsd.c:261:64: style: Parameter 'mo' can be declared as pointer to const [constParameterPointer]
int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo)
^
lib/mount_bsd.c:190:12: style: Variable 'ret' is assigned a value that is never used. [unreadVariable]
int ret = -1;
^
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/mount_bsd.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
47/75 files checked 50% done
Checking lib/usdt.h ...
Checking lib/usdt.h: FUSE_USE_VERSION=319...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__LP64__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__STDC_VERSION__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__arm__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__i386__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__ia64__;__s390__;__s390x__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__loongarch__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__powerpc64__;__powerpc__...
Checking lib/usdt.h: FUSE_USE_VERSION=319;__powerpc__...
48/75 files checked 52% done
Checking lib/util.c ...
Checking lib/util.c: FUSE_USE_VERSION=319...
Checking lib/util.c: FUSE_USE_VERSION=319;FUSE_H_;FUSE_LOWLEVEL_H_...
Checking lib/util.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking lib/util.c: FUSE_USE_VERSION=319;HAVE_PTHREAD_SETNAME_NP...
Checking lib/util.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
49/75 files checked 52% done
Checking lib/fuse.c ...
Checking lib/fuse.c: FUSE_USE_VERSION=319...
lib/fuse.c:5025:30: style: Parameter 'version' can be declared as pointer to const [constParameterPointer]
struct libfuse_version *version, void *user_data)
^
Checking lib/fuse.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
lib/fuse.c:2971:19: warning: Uninitialized variable: &e [uninitvar]
reply_entry(req, &e, err);
^
lib/fuse.c:2945:6: note: Assuming condition is false
if (!err) {
^
lib/fuse.c:2971:19: note: Uninitialized variable: &e
reply_entry(req, &e, err);
^
lib/fuse.c:2993:19: warning: Uninitialized variable: &e [uninitvar]
reply_entry(req, &e, err);
^
lib/fuse.c:2983:6: note: Assuming condition is false
if (!err) {
^
lib/fuse.c:2993:19: note: Uninitialized variable: &e
reply_entry(req, &e, err);
^
lib/fuse.c:3076:19: warning: Uninitialized variable: &e [uninitvar]
reply_entry(req, &e, err);
^
lib/fuse.c:3066:6: note: Assuming condition is false
if (!err) {
^
lib/fuse.c:3076:19: note: Uninitialized variable: &e
reply_entry(req, &e, err);
^
lib/fuse.c:3139:19: warning: Uninitialized variable: &e [uninitvar]
reply_entry(req, &e, err);
^
lib/fuse.c:3128:6: note: Assuming condition is false
if (!err) {
^
lib/fuse.c:3139:19: note: Uninitialized variable: &e
reply_entry(req, &e, err);
^
Checking lib/fuse.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse.c: FUSE_USE_VERSION=319;HAVE_ICONV;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;HAVE_STATX;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/fuse.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/fuse.c: FUSE_USE_VERSION=319;HAVE_UTIMENSAT;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;__FreeBSD__;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;__FreeBSD__;__NetBSD__;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;__KERNEL__;FUSE_USE_VERSION...
Checking lib/fuse.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
50/75 files checked 65% done
Checking lib/fuse_i.h ...
Checking lib/fuse_i.h: FUSE_USE_VERSION=319...
Checking lib/fuse_i.h: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_i.h: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_i.h: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_i.h: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
51/75 files checked 66% done
Checking lib/fuse_lowlevel.c ...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319...
lib/fuse_lowlevel.c:1336:15: style: The scope of the variable 'i' can be reduced. [variableScope]
unsigned int i;
^
lib/fuse_lowlevel.c:1445:31: style: The scope of the variable 'arg' can be reduced. [variableScope]
const struct fuse_access_in *arg = op_in;
^
lib/fuse_lowlevel.c:1481:14: style: The scope of the variable 'name' can be reduced. [variableScope]
const char *name = in_payload;
^
lib/fuse_lowlevel.c:1506:14: style: The scope of the variable 'name' can be reduced. [variableScope]
const char *name = in_payload;
^
lib/fuse_lowlevel.c:1530:14: style: The scope of the variable 'name' can be reduced. [variableScope]
const char *name = in_payload;
^
lib/fuse_lowlevel.c:1548:14: style: The scope of the variable 'name' can be reduced. [variableScope]
const char *name = in_payload;
^
lib/fuse_lowlevel.c:1606:32: style: The scope of the variable 'arg' can be reduced. [variableScope]
const struct fuse_rename2_in *arg = op_in;
^
lib/fuse_lowlevel.c:1676:14: style: The scope of the variable 'name' can be reduced. [variableScope]
const char *name = in_payload;
^
lib/fuse_lowlevel.c:1761:14: style: The scope of the variable 'buf' can be reduced. [variableScope]
const char *buf = in_payload;
^
lib/fuse_lowlevel.c:2094:33: style: The scope of the variable 'arg' can be reduced. [variableScope]
const struct fuse_getxattr_in *arg = op_in;
^
lib/fuse_lowlevel.c:2115:33: style: The scope of the variable 'arg' can be reduced. [variableScope]
const struct fuse_getxattr_in *arg = inarg;
^
lib/fuse_lowlevel.c:2132:14: style: The scope of the variable 'name' can be reduced. [variableScope]
const char *name = in_payload;
^
lib/fuse_lowlevel.c:2342:29: style: The scope of the variable 'arg' can be reduced. [variableScope]
const struct fuse_bmap_in *arg = op_in;
^
lib/fuse_lowlevel.c:2359:14: style: The scope of the variable 'in_buf' can be reduced. [variableScope]
const void *in_buf = in_payload;
^
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_PIPE2;O_CLOEXEC;HAVE_SPLICE;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_SPLICE;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_SPLICE;HAVE_VMSPLICE;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_STATX;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;USDT_ENABLED;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__KERNEL__;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__LP64__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__arm__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__i386__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__ia64__;__s390__;__s390x__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__loongarch__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__powerpc64__;__powerpc__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;__powerpc__...
Checking lib/fuse_lowlevel.c: FUSE_USE_VERSION=319;linux;FUSE_USE_VERSION...
52/75 files checked 78% done
Checking lib/helper.c ...
Checking lib/helper.c: FUSE_USE_VERSION=319...
Checking lib/helper.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/helper.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/helper.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/helper.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/helper.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/helper.c: FUSE_USE_VERSION=319;__FreeBSD__;FUSE_USE_VERSION...
Checking lib/helper.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
53/75 files checked 80% done
Checking lib/fuse_uring.c ...
Checking lib/fuse_uring.c: FUSE_USE_VERSION=319...
Checking lib/fuse_uring.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/fuse_uring.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/fuse_uring.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/fuse_uring.c: FUSE_USE_VERSION=319;__KERNEL__;FUSE_USE_VERSION...
Checking lib/fuse_uring.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
54/75 files checked 82% done
Checking lib/mount.c ...
Checking lib/mount.c: FUSE_USE_VERSION=319...
lib/mount.c:130:63: style: Parameter 'action' can be declared as pointer to const [constParameterPointer]
static int fusermount_posix_spawn(posix_spawn_file_actions_t *action,
^
Checking lib/mount.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_;FUSE_USE_VERSION...
Checking lib/mount.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking lib/mount.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H;FUSE_USE_VERSION...
Checking lib/mount.c: FUSE_USE_VERSION=319;HAVE_STRUCT_STAT_ST_ATIMESPEC...
Checking lib/mount.c: FUSE_USE_VERSION=319;HAVE_SYMVER_ATTRIBUTE...
Checking lib/mount.c: FUSE_USE_VERSION=319;__NetBSD__;FUSE_USE_VERSION...
Checking lib/mount.c: FUSE_USE_VERSION=319;__STDC_VERSION__;FUSE_USE_VERSION...
55/75 files checked 84% done
Checking lib/mount_util.c ...
Checking lib/mount_util.c: FUSE_USE_VERSION=319...
Checking lib/mount_util.c: FUSE_USE_VERSION=319;__ANDROID__;__DragonFly__;__FreeBSD__;__NetBSD__...
Checking lib/mount_util.c: FUSE_USE_VERSION=319;__DragonFly__;__FreeBSD__;__FreeBSD_kernel__;__NetBSD__...
56/75 files checked 85% done
Checking lib/mount_util.h ...
Checking lib/mount_util.h: FUSE_USE_VERSION=319...
57/75 files checked 85% done
Checking lib/util.h ...
Checking lib/util.h: FUSE_USE_VERSION=319...
58/75 files checked 85% done
Checking test/hello.c ...
Checking test/hello.c: FUSE_USE_VERSION=319...
Checking test/hello.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/hello.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/hello.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
59/75 files checked 86% done
Checking test/readdir_inode.c ...
Checking test/readdir_inode.c: FUSE_USE_VERSION=319...
test/readdir_inode.c:31:12: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
dent = readdir(dirp);
^
test/readdir_inode.c:47:16: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
dent = readdir(dirp);
^
test/readdir_inode.c:17:20: style: Variable 'dent' can be declared as pointer to const [constVariablePointer]
struct dirent* dent;
^
60/75 files checked 86% done
Checking test/release_unlink_race.c ...
Checking test/release_unlink_race.c: FUSE_USE_VERSION=319...
test/release_unlink_race.c:66:56: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
if(!getenv("RELEASEUNLINKRACE_DELAY_DISABLE")) usleep(100000);
^
test/release_unlink_race.c:91:56: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
if(!getenv("RELEASEUNLINKRACE_DELAY_DISABLE")) usleep(100000);
^
Checking test/release_unlink_race.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/release_unlink_race.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/release_unlink_race.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
61/75 files checked 86% done
Checking test/stracedecode.c ...
Checking test/stracedecode.c: FUSE_USE_VERSION=319...
test/stracedecode.c:68:3: warning: %i in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
printf("unique: %llu, opcode: %s (%i), nodeid: %lu, len: %i, insize: %i\n",
^
test/stracedecode.c:68:3: warning: %i in format string (no. 5) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
printf("unique: %llu, opcode: %s (%i), nodeid: %lu, len: %i, insize: %i\n",
^
test/stracedecode.c:76:4: warning: %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("-READ fh:%llu off:%llu siz:%u rfl:%u own:%llu fl:%u\n",
^
test/stracedecode.c:76:4: warning: %llu in format string (no. 2) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("-READ fh:%llu off:%llu siz:%u rfl:%u own:%llu fl:%u\n",
^
test/stracedecode.c:76:4: warning: %llu in format string (no. 5) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("-READ fh:%llu off:%llu siz:%u rfl:%u own:%llu fl:%u\n",
^
test/stracedecode.c:83:4: warning: %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("-WRITE fh:%llu off:%llu siz:%u wfl:%u own:%llu fl:%u\n",
^
test/stracedecode.c:83:4: warning: %llu in format string (no. 2) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("-WRITE fh:%llu off:%llu siz:%u wfl:%u own:%llu fl:%u\n",
^
test/stracedecode.c:83:4: warning: %llu in format string (no. 5) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("-WRITE fh:%llu off:%llu siz:%u wfl:%u own:%llu fl:%u\n",
^
test/stracedecode.c:95:3: warning: %i in format string (no. 4) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
printf(" unique: %llu, error: %i (%s), len: %i, outsize: %i\n",
^
test/stracedecode.c:103:5: warning: %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ATTR v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:103:5: warning: %llu in format string (no. 3) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ATTR v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:103:5: warning: %llu in format string (no. 4) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ATTR v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:103:5: warning: %llu in format string (no. 5) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ATTR v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:110:5: warning: %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ENTRY nodeid:%llu v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:110:5: warning: %llu in format string (no. 2) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ENTRY nodeid:%llu v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:110:5: warning: %llu in format string (no. 4) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ENTRY nodeid:%llu v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:110:5: warning: %llu in format string (no. 5) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ENTRY nodeid:%llu v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:110:5: warning: %llu in format string (no. 6) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint]
printf("+ENTRY nodeid:%llu v:%llu.%09u i:%llu s:%llu b:%llu\n",
^
test/stracedecode.c:178:14: warning: %x in format string (no. 1) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int]
res = scanf("%x", &val);
^
test/stracedecode.c:65:26: style: Variable 'in' can be declared as pointer to const [constVariablePointer]
struct fuse_in_header *in = (struct fuse_in_header *) buf;
^
test/stracedecode.c:75:25: style: Variable 'arg' can be declared as pointer to const [constVariablePointer]
struct fuse_read_in *arg = (struct fuse_read_in *) buf;
^
test/stracedecode.c:82:26: style: Variable 'arg' can be declared as pointer to const [constVariablePointer]
struct fuse_write_in *arg = (struct fuse_write_in *) buf;
^
test/stracedecode.c:92:27: style: Variable 'out' can be declared as pointer to const [constVariablePointer]
struct fuse_out_header *out = (struct fuse_out_header *) buf;
^
test/stracedecode.c:102:27: style: Variable 'arg' can be declared as pointer to const [constVariablePointer]
struct fuse_attr_out *arg = (struct fuse_attr_out *) buf;
^
test/stracedecode.c:109:28: style: Variable 'arg' can be declared as pointer to const [constVariablePointer]
struct fuse_entry_out *arg = (struct fuse_entry_out *) buf;
^
Checking test/stracedecode.c: FUSE_USE_VERSION=319;__KERNEL__...
62/75 files checked 86% done
Checking test/test_abi.c ...
Checking test/test_abi.c: FUSE_USE_VERSION=319...
Checking test/test_abi.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/test_abi.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/test_abi.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
63/75 files checked 86% done
Checking test/test_setattr.c ...
Checking test/test_setattr.c: FUSE_USE_VERSION=319...
test/test_setattr.c:142:12: warning: Assert statement calls a function which may have desired side effects: 'snprintf'. [assertWithSideEffect]
assert(snprintf(fname, PATH_MAX, "%s/" FILE_NAME,
^
test/test_setattr.c:150:12: warning: Assert statement calls a function which may have desired side effects: 'fchmod'. [assertWithSideEffect]
assert(fchmod(fd, 0600) == 0);
^
test/test_setattr.c:171:12: warning: Assert statement calls a function which may have desired side effects: 'pthread_create'. [assertWithSideEffect]
assert(pthread_create(&fs_thread, NULL, run_fs, (void *)se) == 0);
^
test/test_setattr.c:150:19: warning: Either the condition 'fd==-1' is redundant or fchmod() argument nr 1 can have invalid value. The value is -1 but the valid values are '0:'. [invalidFunctionArg]
assert(fchmod(fd, 0600) == 0);
^
test/test_setattr.c:145:12: note: Assuming that condition 'fd==-1' is not redundant
if (fd == -1) {
^
test/test_setattr.c:150:19: note: Invalid argument
assert(fchmod(fd, 0600) == 0);
^
test/test_setattr.c:151:11: warning: Either the condition 'fd==-1' is redundant or close() argument nr 1 can have invalid value. The value is -1 but the valid values are '0:'. [invalidFunctionArg]
close(fd);
^
test/test_setattr.c:145:12: note: Assuming that condition 'fd==-1' is not redundant
if (fd == -1) {
^
test/test_setattr.c:151:11: note: Invalid argument
close(fd);
^
Checking test/test_setattr.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/test_setattr.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/test_setattr.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
Checking test/test_setattr.c: FUSE_USE_VERSION=319;__linux__...
64/75 files checked 87% done
Checking test/test_signals.c ...
Checking test/test_signals.c: FUSE_USE_VERSION=319...
test/test_signals.c:56:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
usleep(2 * 1000 * 1000);
^
test/test_signals.c:56:18: error: Invalid usleep() argument nr 1. The value is 2000000 but the valid values are '0:999999'. [invalidFunctionArg]
usleep(2 * 1000 * 1000);
^
Checking test/test_signals.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/test_signals.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/test_signals.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
65/75 files checked 87% done
Checking test/test_syscalls.c ...
Checking test/test_syscalls.c: FUSE_USE_VERSION=319...
test/test_syscalls.c:420:8: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
de = readdir(dp);
^
test/test_syscalls.c:794:8: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
de = readdir(dp);
^
test/test_syscalls.c:806:8: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
de = readdir(dp);
^
test/test_syscalls.c:811:8: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
de = readdir(dp);
^
test/test_syscalls.c:984:8: style: Obsolescent function 'utime' called. It is recommended to use 'utimensat' instead. [utimeCalled]
res = utime(testfile, &utm);
^
test/test_syscalls.c:1934:3: error: Resource leak: fd [resourceLeak]
return -1;
^
test/test_syscalls.c:2038:3: error: Resource leak: fd [resourceLeak]
return -1;
^
test/test_syscalls.c:2072:3: error: Resource leak: fd [resourceLeak]
return -1;
^
test/test_syscalls.c:2083:3: error: Resource leak: fd [resourceLeak]
return -1;
^
test/test_syscalls.c:2088:3: error: Resource leak: fd [resourceLeak]
return -1;
^
test/test_syscalls.c:275:56: style: Parameter 'st' can be declared as pointer to const [constParameterPointer]
static int fcheck_stat(int fd, int flags, struct stat *st)
^
Checking test/test_syscalls.c: FUSE_USE_VERSION=319;HAVE_COPY_FILE_RANGE...
Checking test/test_syscalls.c: FUSE_USE_VERSION=319;HAVE_STATX...
66/75 files checked 92% done
Checking test/test_want_conversion.c ...
Checking test/test_want_conversion.c: FUSE_USE_VERSION=319...
Checking test/test_want_conversion.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/test_want_conversion.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/test_want_conversion.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
67/75 files checked 93% done
Checking test/test_write_cache.c ...
Checking test/test_write_cache.c: FUSE_USE_VERSION=319...
test/test_write_cache.c:232:9: warning: Assert statement calls a function which may have desired side effects: 'read'. [assertWithSideEffect]
assert(read(fd, buf, dsize) == dsize);
^
test/test_write_cache.c:235:9: warning: Assert statement calls a function which may have desired side effects: 'snprintf'. [assertWithSideEffect]
assert(snprintf(fname, PATH_MAX, "%s/" FILE_NAME, mountpoint) > 0);
^
test/test_write_cache.c:245:10: warning: Assert statement calls a function which may have desired side effects: 'pthread_create'. [assertWithSideEffect]
assert(pthread_create(&rofd_thread, NULL, close_rofd,
^
test/test_write_cache.c:252:10: warning: Assert statement calls a function which may have desired side effects: 'pwrite'. [assertWithSideEffect]
assert(pwrite(fd, buf + off, iosize, off) == iosize);
^
test/test_write_cache.c:262:10: warning: Assert statement calls a function which may have desired side effects: 'pthread_join'. [assertWithSideEffect]
assert(pthread_join(rofd_thread, NULL) == 0);
^
test/test_write_cache.c:285:9: warning: Assert statement calls a function which may have desired side effects: 'pthread_create'. [assertWithSideEffect]
assert(pthread_create(&fs_thread, NULL, run_fs, (void *)se) == 0);
^
test/test_write_cache.c:294:9: warning: Assert statement calls a function which may have desired side effects: 'pthread_join'. [assertWithSideEffect]
assert(pthread_join(fs_thread, NULL) == 0);
^
test/test_write_cache.c:170:3: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
usleep(options.delay_ms * 1000);
^
test/test_write_cache.c:248:3: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
usleep(options.delay_ms * 1000);
^
test/test_write_cache.c:249:2: error: Resource leak: rofd [resourceLeak]
}
^
Checking test/test_write_cache.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/test_write_cache.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/test_write_cache.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
Checking test/test_write_cache.c: FUSE_USE_VERSION=319;__linux__...
68/75 files checked 93% done
Checking test/wrong_command.c ...
Checking test/wrong_command.c: FUSE_USE_VERSION=319...
Checking test/wrong_command.c: FUSE_USE_VERSION=319;MESON_IS_SUBPROJECT...
69/75 files checked 93% done
Checking test/test_teardown_watchdog.c ...
Checking test/test_teardown_watchdog.c: FUSE_USE_VERSION=319...
test/test_teardown_watchdog.c:71:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
usleep(uta->delay_ms * 1000);
^
test/test_teardown_watchdog.c:165:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
usleep(500 * 1000);
^
test/test_teardown_watchdog.c:180:3: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [usleepCalled]
usleep(100 * 1000);
^
Checking test/test_teardown_watchdog.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking test/test_teardown_watchdog.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking test/test_teardown_watchdog.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
70/75 files checked 94% done
Checking util/fusermount.c ...
Checking util/fusermount.c: FUSE_USE_VERSION=319...
util/fusermount.c:185:22: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [getpwuidCalled]
struct passwd *pw = getpwuid(getuid());
^
util/fusermount.c:1328:12: warning: If memory allocation fails, then there is a possible null pointer dereference: x_mnt_opts [nullPointerOutOfMemory]
strncat(x_mnt_opts, x_opts,
^
util/fusermount.c:1321:29: note: Assuming allocation function fails
char *x_mnt_opts = calloc(1, x_mnt_opts_len);
^
util/fusermount.c:1321:29: note: Assignment 'x_mnt_opts=calloc(1,x_mnt_opts_len)', assigned value is 0
char *x_mnt_opts = calloc(1, x_mnt_opts_len);
^
util/fusermount.c:1328:12: note: Null pointer dereference
strncat(x_mnt_opts, x_opts,
^
util/fusermount.c:357:14: style: The scope of the variable 'mnt' can be reduced. [variableScope]
const char *mnt = a[1];
^
util/fusermount.c:602:6: style: The scope of the variable 'n_mounts' can be reduced. [variableScope]
int n_mounts = 0;
^
util/fusermount.c:609:20: style: Variable 'sm' can be declared as pointer to const [constVariablePointer]
struct statmount *sm;
^
util/fusermount.c:602:15: style: Variable 'n_mounts' is assigned a value that is never used. [unreadVariable]
int n_mounts = 0;
^
util/fusermount.c:603:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable]
int ret = 0;
^
Checking util/fusermount.c: FUSE_USE_VERSION=319;GETMNTENT_NEEDS_UNESCAPING...
Checking util/fusermount.c: FUSE_USE_VERSION=319;HAVE_CLOSE_RANGE...
Checking util/fusermount.c: FUSE_USE_VERSION=319;HAVE_CLOSE_RANGE;linux...
Checking util/fusermount.c: FUSE_USE_VERSION=319;HAVE_LISTMOUNT...
Checking util/fusermount.c: FUSE_USE_VERSION=319;IGNORE_MTAB...
Checking util/fusermount.c: FUSE_USE_VERSION=319;__ia64__...
71/75 files checked 98% done
Checking util/mount.fuse.c ...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319...
util/mount.fuse.c:314:10: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [strtokCalled]
opt = strtok(opts, ",");
^
util/mount.fuse.c:348:11: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [strtokCalled]
opt = strtok(NULL, ",");
^
util/mount.fuse.c:409:24: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [getpwnamCalled]
struct passwd *pwd = getpwnam(setuid_name);
^
util/mount.fuse.c:409:18: style: Variable 'pwd' can be declared as pointer to const [constVariablePointer]
struct passwd *pwd = getpwnam(setuid_name);
^
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;FUSE_LOWLEVEL_H_...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;FUSE_USE_VERSION=30...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;HAVE_LIBFUSE_PRIVATE_CONFIG_H...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;SECBIT_KEEP_CAPS;SECURE_KEEP_CAPS;linux...
util/mount.fuse.c:212:4: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
fprintf(stderr,
^
util/mount.fuse.c:218:4: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
fprintf(stderr,
^
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;SECBIT_KEEP_CAPS_LOCKED;SECURE_KEEP_CAPS_LOCKED;linux...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;SECBIT_NOROOT;SECURE_NOROOT;linux...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;SECBIT_NOROOT_LOCKED;SECURE_NOROOT_LOCKED;linux...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;SECBIT_NO_SETUID_FIXUP;SECURE_NO_SETUID_FIXUP;linux...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;SECBIT_NO_SETUID_FIXUP_LOCKED;SECURE_NO_SETUID_FIXUP_LOCKED;linux...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;__STDC_VERSION__...
Checking util/mount.fuse.c: FUSE_USE_VERSION=319;linux...
72/75 files checked 99% done
Checking build-x86_64/meson-private/sanitycheckc.c ...
Checking build-x86_64/meson-private/sanitycheckc.c: FUSE_USE_VERSION=319...
73/75 files checked 99% done
Checking build-x86_64/fuse_config.h ...
Checking build-x86_64/fuse_config.h: FUSE_USE_VERSION=319...
74/75 files checked 99% done
Checking build-x86_64/libfuse_config.h ...
Checking build-x86_64/libfuse_config.h: FUSE_USE_VERSION=319...
75/75 files checked 100% done
include/fuse.h:923:0: style: The function 'fuse_main_real' is never used. [unusedFunction]
static inline int fuse_main_real(int argc, char *argv[],
^
lib/fuse.c:370:0: style: The function 'list_add_head' is never used. [unusedFunction]
static inline void list_add_head(struct list_head *new, struct list_head *head)
^
lib/fuse.c:1819:0: style: The function 'fuse_fs_read' is never used. [unusedFunction]
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *mem, size_t size,
^
lib/fuse.c:1924:0: style: The function 'fuse_fs_write' is never used. [unusedFunction]
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *mem,
^
lib/fuse.c:4718:0: style: The function 'fuse_loop_mt_31' is never used. [unusedFunction]
int fuse_loop_mt_31(struct fuse *f, int clone_fd)
^
lib/fuse.c:4735:0: style: The function 'fuse_exit' is never used. [unusedFunction]
void fuse_exit(struct fuse *f)
^
lib/fuse.c:4750:0: style: The function 'fuse_getgroups' is never used. [unusedFunction]
int fuse_getgroups(int size, gid_t list[])
^
lib/fuse.c:4759:0: style: The function 'fuse_interrupted' is never used. [unusedFunction]
int fuse_interrupted(void)
^
lib/fuse.c:5213:0: style: The function 'fuse_new_30' is never used. [unusedFunction]
struct fuse *fuse_new_30(struct fuse_args *args,
^
lib/fuse.c:5299:0: style: The function 'fuse_version' is never used. [unusedFunction]
int fuse_version(void)
^
lib/fuse_log.c:32:0: style: The function 'fuse_set_log_func' is never used. [unusedFunction]
void fuse_set_log_func(fuse_log_func_t func)
^
lib/fuse_log.c:49:0: style: The function 'fuse_log_enable_syslog' is never used. [unusedFunction]
void fuse_log_enable_syslog(const char *ident, int option, int facility)
^
lib/fuse_log.c:56:0: style: The function 'fuse_log_close_syslog' is never used. [unusedFunction]
void fuse_log_close_syslog(void)
^
lib/fuse_loop_mt.c:439:0: style: The function 'fuse_session_loop_mt_32' is never used. [unusedFunction]
int fuse_session_loop_mt_32(struct fuse_session *se, const struct fuse_loop_config_v1 *config_v1)
^
lib/fuse_loop_mt.c:463:0: style: The function 'fuse_session_loop_mt_31' is never used. [unusedFunction]
int fuse_session_loop_mt_31(struct fuse_session *se, int clone_fd)
^
lib/fuse_lowlevel.c:365:0: style: The function 'fuse_reply_iov' is never used. [unusedFunction]
int fuse_reply_iov(fuse_req_t req, const struct iovec *iov, int count)
^
lib/fuse_lowlevel.c:580:0: style: The function 'fuse_passthrough_open' is never used. [unusedFunction]
int fuse_passthrough_open(fuse_req_t req, int fd)
^
lib/fuse_lowlevel.c:594:0: style: The function 'fuse_passthrough_close' is never used. [unusedFunction]
int fuse_passthrough_close(fuse_req_t req, int backing_id)
^
lib/fuse_lowlevel.c:3240:0: style: The function 'fuse_lowlevel_notify_delete' is never used. [unusedFunction]
int fuse_lowlevel_notify_delete(struct fuse_session *se,
^
lib/fuse_lowlevel.c:3450:0: style: The function 'fuse_req_is_uring' is never used. [unusedFunction]
bool fuse_req_is_uring(fuse_req_t req)
^
lib/fuse_lowlevel.c:4177:0: style: The function 'fuse_session_receive_buf' is never used. [unusedFunction]
int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf)
^
lib/fuse_lowlevel.c:4397:0: style: The function 'fuse_session_custom_io_30' is never used. [unusedFunction]
int fuse_session_custom_io_30(struct fuse_session *se,
^
lib/fuse_lowlevel.c:4464:0: style: The function 'fuse_session_fd' is never used. [unusedFunction]
int fuse_session_fd(const struct fuse_session *se)
^
lib/fuse_lowlevel.c:4561:0: style: The function 'fuse_session_reset' is never used. [unusedFunction]
void fuse_session_reset(struct fuse_session *se)
^
lib/fuse_opt.c:201:0: style: The function 'fuse_opt_match' is never used. [unusedFunction]
int fuse_opt_match(const struct fuse_opt *opts, const char *opt)
^
lib/fuse_signals.c:175:0: style: The function 'fuse_set_fail_signal_handlers' is never used. [unusedFunction]
int fuse_set_fail_signal_handlers(struct fuse_session *se)
^
lib/fuse_uring.c:209:0: style: The function 'fuse_req_get_payload' is never used. [unusedFunction]
int fuse_req_get_payload(fuse_req_t req, char **payload, size_t *payload_sz,
^
lib/helper.c:237:0: style: The function 'fuse_parse_cmdline_30' is never used. [unusedFunction]
int fuse_parse_cmdline_30(struct fuse_args *args,
^
lib/helper.c:422:0: style: The function 'fuse_apply_conn_info_opts' is never used. [unusedFunction]
void fuse_apply_conn_info_opts(const struct fuse_conn_info_opts *opts,
^
lib/helper.c:476:0: style: The function 'fuse_parse_conn_info_opts' is never used. [unusedFunction]
struct fuse_conn_info_opts* fuse_parse_conn_info_opts(struct fuse_args *args)
^
lib/cuse_lowlevel.c:147:0: style: The function 'cuse_lowlevel_new' should have static linkage since it is not used outside of its translation unit. [staticFunction]
struct fuse_session *cuse_lowlevel_new(struct fuse_args *args,
^
lib/cuse_lowlevel.c:273:0: style: The function 'cuse_lowlevel_setup' should have static linkage since it is not used outside of its translation unit. [staticFunction]
struct fuse_session *cuse_lowlevel_setup(int argc, char *argv[],
^
lib/cuse_lowlevel.c:344:0: style: The function 'cuse_lowlevel_teardown' should have static linkage since it is not used outside of its translation unit. [staticFunction]
void cuse_lowlevel_teardown(struct fuse_session *se)
^
lib/fuse.c:2253:0: style: The function 'fuse_fs_ioctl' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, unsigned int cmd,
^
lib/fuse.c:2267:0: style: The function 'fuse_fs_poll' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_fs_poll(struct fuse_fs *fs, const char *path,
^
lib/fuse.c:2290:0: style: The function 'fuse_fs_fallocate' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode,
^
lib/fuse.c:2306:0: style: The function 'fuse_fs_copy_file_range' should have static linkage since it is not used outside of its translation unit. [staticFunction]
ssize_t fuse_fs_copy_file_range(struct fuse_fs *fs, const char *path_in,
^
lib/fuse.c:2377:0: style: The function 'fuse_fs_syncfs' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_fs_syncfs(struct fuse_fs *fs, const char *path)
^
lib/fuse.c:4526:0: style: The function 'fuse_clean_cache' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_clean_cache(struct fuse *f)
^
lib/fuse.c:4685:0: style: The function 'fuse_loop_mt_312' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_loop_mt_312(struct fuse *f, struct fuse_loop_config *config)
^
lib/fuse.c:5001:0: style: The function 'fuse_start_cleanup_thread' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_start_cleanup_thread(struct fuse *f)
^
lib/fuse.c:5009:0: style: The function 'fuse_stop_cleanup_thread' should have static linkage since it is not used outside of its translation unit. [staticFunction]
void fuse_stop_cleanup_thread(struct fuse *f)
^
lib/fuse.c:5196:0: style: The function 'fuse_new_31' should have static linkage since it is not used outside of its translation unit. [staticFunction]
struct fuse *fuse_new_31(struct fuse_args *args,
^
lib/fuse_loop_mt.c:497:0: style: The function 'fuse_loop_cfg_verify' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_loop_cfg_verify(const struct fuse_loop_config *config)
^
lib/fuse_opt.c:95:0: style: The function 'fuse_opt_insert_arg' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg)
^
lib/helper.c:208:0: style: The function 'fuse_parse_cmdline_312' should have static linkage since it is not used outside of its translation unit. [staticFunction]
int fuse_parse_cmdline_312(struct fuse_args *args,
^
nofile:0:0: information: Active checkers: 109/856 (use --checkers-report=<filename> to see details) [checkersReport]
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-02 16:26 UTC (permalink / raw)
To: Darrick J. Wong
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <2f2ba053-53a7-43e5-969a-32d185e9c7b7@bsbernd.com>
On 5/2/26 17:59, Bernd Schubert wrote:
>
>
> On 5/1/26 00:49, Darrick J. Wong wrote:
>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
>>> Hi Darrick,
>>>
>>> On 4/30/26 23:18, Darrick J. Wong wrote:
>>>> Hi Bernd,
>>>>
>>>> Please pull this branch with changes for libfuse.
>>>>
>>>> As usual, I did a test-merge with the main upstream branch as of a few
>>>> minutes ago, and didn't see any conflicts. Please let me know if you
>>>> encounter any problems.
>>>
>>> pushed to my github branch. BSD build fails with
>>>
>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
>>> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
>>
>> Aha, that function got left out of the stub. :(
>>
>> Annoyingly, on Linux the build succeeds despite the missing symbol
>> when I tweak meson so that it doesn't build the service stuff. I would
>> have thought that --no-undefined would have done that, but alas.
>>
>> Sorry about that too. The following patch fixes it.
>>
>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
>> index d34df3891a6e31..231b98423df628 100644
>> --- i/lib/fuse_service_stub.c
>> +++ w/lib/fuse_service_stub.c
>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
>> int fuse_service_accept(struct fuse_service **sfp)
>> {
>> *sfp = NULL;
>> return 0;
>> }
>>
>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
>> +{
>> + return false;
>> +}
>> +
>> int fuse_service_append_args(struct fuse_service *sf,
>> struct fuse_args *existing_args)
>> {
>> return -EOPNOTSUPP;
>> }
>>
>>
>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
>>>
>>>
>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
>>
>> Not sure why checkpatch fails, this is what I got (Debian 13):
>>
>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
>> total: 0 errors, 0 warnings, 3908 lines checked
>>
>> Your patch has no obvious style problems and is ready for submission.
>>
>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
>>
>> cppcheck had a few things to say, but none of it was about the changed
>> lines.
>>
>>> report is funny
>>>
>>>> int mount_service_main(int argc, char *argv[])
>>>> Warning
>>>> Poorly documented large function
>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
>>>> CodeQL
>>
>> Hrmm. I guess I'll have to figure out how to get those things running.
>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
>> it's not public library API) so I didn't comment them as intensely.
>> Would you like more?
>>
>>> I think I'm going to merge my sync fuse init series tomorrow.
>>
>> Yay!
>>
>>> Are you ok if skip posting another version of the series?
>>
>> ^ is there an "I" here? e.g. "...if I skip posting..."?
>>
>> /My/ normal practice (from xfs) was to repost the series as it was
>> merged, followed by an announcement. That way the mailing list is a
>> complete record of what was merged. However, very very few people
>> actually do that, even in the kernel.
>>
>> I'm ok with you not posting another version of the series.
>>
>>> Or do you prefer to review the recent changes and last piece I'm going
>>> to do tomorrow?
>>
>> Nah, just merge it. I'll look over the changes once it's in the branch
>> and if there's anything weird, you or I or anyone else can send patches.
>> As long as you're not planning to tag it as a release, nothing's set in
>> stone.
>>
>>> Basically my goal is to rebase your series against it immediately and
>>> to merge your series during the next few days.
>>
>> <nod> Let me know what you want changed, I'll be around since I am not
>> travelling anywhere for a couple of weeks. :)
>>
>> I can reflow changes into the patchset, or if you'd prefer, I can add
>> them as new patches that would go on the end of the series.
>>
>
> Hi Darrick,
>
> eventually merged my patches and made a quick rebase and conflict
> resolving with your branch. Github still reports plenty of issues ;)
>
> Could you fix all of the checkpatch isssues? This one shows plenty
> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
>
> bschubert2@imesrv6 libfuse.git>stg series
> + mount_service-add-systemd
> + mount_service-create-high
> + mount_service-use-the-new
> + mount_service-update-mtab
>> util-hoist-the-fuse.conf
> - util-fix-checkpatch-complaints
> - mount_service-enable
> - mount.fuse3-integrate-systemd
> - mount_service-allow
> - example-service_ll-create-a
> - example-service-create-a
> - nullfs-support-fuse-systemd
> - meson-show-feature-summary
> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
> #61: FILE: util/fuser_conf.c:33:
> +int user_allow_other = 0;
>
> WARNING:LINE_SPACING: Missing a blank line after declarations
> #74: FILE: util/fuser_conf.c:46:
> + char *dest = buf;
> + while (1) {
>
> ...
>
> I don't have a strong opinion about these two above - feel
> free to disable them. However, in order to merge it, it would
> be good to run without any checkpatch report.
> And everything that cppcheck and gcc-checker reports, definitely
> need to be fixed.
Basically
cd <$FUSEDIR>
BUILDDIR="build-without-examples"
mkdir -p ${BUILDDIR}
meson setup ${BUILDDIR} -Dexamples=false
ninja -C ${BUILDDIR}
./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}
gcc reports are starting here
bschubert2@imesrv6 libfuse.git>stg series
+ mount_service-add-systemd
+ mount_service-create-high
+ mount_service-use-the-new
+ mount_service-update-mtab
+ util-hoist-the-fuse.conf
+ util-fix-checkpatch-complaints
+ mount_service-enable
> mount.fuse3-integrate-systemd
bschubert2@imesrv6 libfuse.git>git show |head -n5
commit f908bb1504eca167e156671dde957c2e7192b7d2
Author: Darrick J. Wong <djwong@kernel.org>
Date: Wed Mar 4 13:48:55 2026 -0800
mount.fuse3: integrate systemd service startup
---==== Severity Statistics ====----
----------------------------
Severity | Number of reports
----------------------------
MEDIUM | 1
----------------------------
----=================----
----==== Checker Statistics ====----
-----------------------------------------------------
Checker name | Severity | Number of reports
-----------------------------------------------------
gcc-deref-before-check | MEDIUM | 1
-----------------------------------------------------
----=================----
----==== File Statistics ====----
--------------------------------
File name | Number of reports
--------------------------------
mount.fuse.c | 1
--------------------------------
----=================----
----======== Summary ========----
----------------------------------------------
Number of processed analyzer result files | 45
Number of analyzer reports | 1
----------------------------------------------
----=================----
To view statistics in a browser run:
> firefox /home/bschubert2/src/libfuse/libfuse.git/build-without-examples/codechecker-html/statistics.html
To view the results in a browser run:
> firefox /home/bschubert2/src/libfuse/libfuse.git/build-without-examples/codechecker-html/index.html
[INFO 2026-05-02 18:25] - ----==== Summary ====----
[INFO 2026-05-02 18:25] - Up-to-date analysis results
[INFO 2026-05-02 18:25] - gcc: 37
[INFO 2026-05-02 18:25] - Outdated analysis results
[INFO 2026-05-02 18:25] - Failed to analyze
[INFO 2026-05-02 18:25] - Missing analysis results
[INFO 2026-05-02 18:25] - clangsa: 37
[INFO 2026-05-02 18:25] - clang-tidy: 37
[INFO 2026-05-02 18:25] - cppcheck: 37
[INFO 2026-05-02 18:25] - infer: 37
[INFO 2026-05-02 18:25] - Total analyzed compilation commands: 45
[INFO 2026-05-02 18:25] - Total available compilation commands: 45
[INFO 2026-05-02 18:25] - ----=================----
bschubert2@imesrv6 libfuse.git>
^ permalink raw reply
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-02 15:59 UTC (permalink / raw)
To: Darrick J. Wong
Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <20260430224911.GN7765@frogsfrogsfrogs>
On 5/1/26 00:49, Darrick J. Wong wrote:
> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
>> Hi Darrick,
>>
>> On 4/30/26 23:18, Darrick J. Wong wrote:
>>> Hi Bernd,
>>>
>>> Please pull this branch with changes for libfuse.
>>>
>>> As usual, I did a test-merge with the main upstream branch as of a few
>>> minutes ago, and didn't see any conflicts. Please let me know if you
>>> encounter any problems.
>>
>> pushed to my github branch. BSD build fails with
>>
>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0
>> 2026-04-30T21:25:16.3906762Z cc -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
>
> Aha, that function got left out of the stub. :(
>
> Annoyingly, on Linux the build succeeds despite the missing symbol
> when I tweak meson so that it doesn't build the service stuff. I would
> have thought that --no-undefined would have done that, but alas.
>
> Sorry about that too. The following patch fixes it.
>
> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
> index d34df3891a6e31..231b98423df628 100644
> --- i/lib/fuse_service_stub.c
> +++ w/lib/fuse_service_stub.c
> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
> int fuse_service_accept(struct fuse_service **sfp)
> {
> *sfp = NULL;
> return 0;
> }
>
> +bool fuse_service_can_allow_other(struct fuse_service *sf)
> +{
> + return false;
> +}
> +
> int fuse_service_append_args(struct fuse_service *sf,
> struct fuse_args *existing_args)
> {
> return -EOPNOTSUPP;
> }
>
>
>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
>>
>>
>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
>
> Not sure why checkpatch fails, this is what I got (Debian 13):
>
> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
> total: 0 errors, 0 warnings, 3908 lines checked
>
> Your patch has no obvious style problems and is ready for submission.
>
> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
>
> cppcheck had a few things to say, but none of it was about the changed
> lines.
>
>> report is funny
>>
>>> int mount_service_main(int argc, char *argv[])
>>> Warning
>>> Poorly documented large function
>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
>>> CodeQL
>
> Hrmm. I guess I'll have to figure out how to get those things running.
> That said, the stuff in mount_service.c is internal to libfuse (i.e.
> it's not public library API) so I didn't comment them as intensely.
> Would you like more?
>
>> I think I'm going to merge my sync fuse init series tomorrow.
>
> Yay!
>
>> Are you ok if skip posting another version of the series?
>
> ^ is there an "I" here? e.g. "...if I skip posting..."?
>
> /My/ normal practice (from xfs) was to repost the series as it was
> merged, followed by an announcement. That way the mailing list is a
> complete record of what was merged. However, very very few people
> actually do that, even in the kernel.
>
> I'm ok with you not posting another version of the series.
>
>> Or do you prefer to review the recent changes and last piece I'm going
>> to do tomorrow?
>
> Nah, just merge it. I'll look over the changes once it's in the branch
> and if there's anything weird, you or I or anyone else can send patches.
> As long as you're not planning to tag it as a release, nothing's set in
> stone.
>
>> Basically my goal is to rebase your series against it immediately and
>> to merge your series during the next few days.
>
> <nod> Let me know what you want changed, I'll be around since I am not
> travelling anywhere for a couple of weeks. :)
>
> I can reflow changes into the patchset, or if you'd prefer, I can add
> them as new patches that would go on the end of the series.
>
Hi Darrick,
eventually merged my patches and made a quick rebase and conflict
resolving with your branch. Github still reports plenty of issues ;)
Could you fix all of the checkpatch isssues? This one shows plenty
"util: hoist the fuse.conf parsing and setuid mode enforcement code"
bschubert2@imesrv6 libfuse.git>stg series
+ mount_service-add-systemd
+ mount_service-create-high
+ mount_service-use-the-new
+ mount_service-update-mtab
> util-hoist-the-fuse.conf
- util-fix-checkpatch-complaints
- mount_service-enable
- mount.fuse3-integrate-systemd
- mount_service-allow
- example-service_ll-create-a
- example-service-create-a
- nullfs-support-fuse-systemd
- meson-show-feature-summary
bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh
No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
#61: FILE: util/fuser_conf.c:33:
+int user_allow_other = 0;
WARNING:LINE_SPACING: Missing a blank line after declarations
#74: FILE: util/fuser_conf.c:46:
+ char *dest = buf;
+ while (1) {
...
I don't have a strong opinion about these two above - feel
free to disable them. However, in order to merge it, it would
be good to run without any checkpatch report.
And everything that cppcheck and gcc-checker reports, definitely
need to be fixed.
Thanks,
Bernd
^ permalink raw reply
* [PATCH v13 15/15] ksmbd: Report filesystem case sensitivity via FS_ATTRIBUTE_INFORMATION
From: Chuck Lever @ 2026-05-02 14:21 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
FS_ATTRIBUTE_INFORMATION responses have always reported
FILE_CASE_SENSITIVE_SEARCH and FILE_CASE_PRESERVED_NAMES
unconditionally. Case-insensitive filesystems like exFAT, and
casefolded directories on ext4 or f2fs, have no way to signal
their actual semantics to SMB clients.
Now that filesystems expose case behavior through ->fileattr_get,
query it via vfs_fileattr_get() and translate the FS_XFLAG_CASEFOLD
and FS_XFLAG_CASENONPRESERVING flags into the corresponding SMB
attributes. Filesystems without ->fileattr_get continue reporting
default POSIX behavior (case-sensitive, case-preserving).
SMB's FS_ATTRIBUTE_INFORMATION reports per-share attributes from
the share root, not per-file. Shares mixing casefold and
non-casefold directories report the root directory's behavior.
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/smb/server/smb2pdu.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index ee32e61b6d3c..cf0bc453a036 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -14,6 +14,7 @@
#include <linux/falloc.h>
#include <linux/mount.h>
#include <linux/filelock.h>
+#include <linux/fileattr.h>
#include "glob.h"
#include "smbfsctl.h"
@@ -5541,16 +5542,33 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
case FS_ATTRIBUTE_INFORMATION:
{
FILE_SYSTEM_ATTRIBUTE_INFO *info;
+ struct file_kattr fa = {};
size_t sz;
+ u32 attrs;
+ int err;
info = (FILE_SYSTEM_ATTRIBUTE_INFO *)rsp->Buffer;
- info->Attributes = cpu_to_le32(FILE_SUPPORTS_OBJECT_IDS |
- FILE_PERSISTENT_ACLS |
- FILE_UNICODE_ON_DISK |
- FILE_CASE_PRESERVED_NAMES |
- FILE_CASE_SENSITIVE_SEARCH |
- FILE_SUPPORTS_BLOCK_REFCOUNTING);
+ attrs = FILE_SUPPORTS_OBJECT_IDS |
+ FILE_PERSISTENT_ACLS |
+ FILE_UNICODE_ON_DISK |
+ FILE_SUPPORTS_BLOCK_REFCOUNTING;
+ err = vfs_fileattr_get(path.dentry, &fa);
+ /*
+ * -EINVAL, -EOPNOTSUPP: ntfs-3g and other FUSE
+ * filesystems that lack FS_IOC_FSGETXATTR support.
+ */
+ if (err && err != -ENOIOCTLCMD && err != -ENOTTY &&
+ err != -EINVAL && err != -EOPNOTSUPP) {
+ path_put(&path);
+ return err;
+ }
+ if (!(fa.fsx_xflags & FS_XFLAG_CASEFOLD))
+ attrs |= FILE_CASE_SENSITIVE_SEARCH;
+ if (!(fa.fsx_xflags & FS_XFLAG_CASENONPRESERVING))
+ attrs |= FILE_CASE_PRESERVED_NAMES;
+
+ info->Attributes = cpu_to_le32(attrs);
info->Attributes |= cpu_to_le32(server_conf.share_fake_fscaps);
if (test_share_config_flag(work->tcon->share_conf,
--
2.53.0
^ permalink raw reply related
* [PATCH v13 14/15] nfsd: Implement NFSv4 FATTR4_CASE_INSENSITIVE and FATTR4_CASE_PRESERVING
From: Chuck Lever @ 2026-05-02 14:20 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
NFSD currently provides NFSv4 clients with hard-coded responses
indicating all exported filesystems are case-sensitive and
case-preserving. This is incorrect for case-insensitive filesystems
and ext4 directories with casefold enabled.
Query the underlying filesystem's actual case sensitivity via
nfsd_get_case_info() and return accurate values to clients. This
supports per-directory settings for filesystems that allow mixing
case-sensitive and case-insensitive directories within an export.
The helper queries the parent dentry for non-directory filehandles
because case-folding is a per-directory property. That resolution
has the same corner cases here as for NFSv3 PATHCONF: single-file
exports query an unexported parent, disconnected dentries report
defaults until reconnected, and hardlinked files track whichever
alias the dcache currently holds.
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfsd/nfs4xdr.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 49 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 2a0946c630e1..d77304692e11 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3158,6 +3158,8 @@ struct nfsd4_fattr_args {
u32 rdattr_err;
bool contextsupport;
bool ignore_crossmnt;
+ bool case_insensitive;
+ bool case_preserving;
};
typedef __be32(*nfsd4_enc_attr)(struct xdr_stream *xdr,
@@ -3356,6 +3358,33 @@ static __be32 nfsd4_encode_fattr4_acl(struct xdr_stream *xdr,
return nfs_ok;
}
+static __be32 nfsd4_encode_fattr4_case_insensitive(struct xdr_stream *xdr,
+ const struct nfsd4_fattr_args *args)
+{
+ return nfsd4_encode_bool(xdr, args->case_insensitive);
+}
+
+static __be32 nfsd4_encode_fattr4_case_preserving(struct xdr_stream *xdr,
+ const struct nfsd4_fattr_args *args)
+{
+ return nfsd4_encode_bool(xdr, args->case_preserving);
+}
+
+static __be32 nfsd4_encode_fattr4_homogeneous(struct xdr_stream *xdr,
+ const struct nfsd4_fattr_args *args)
+{
+ /*
+ * Casefold-capable filesystems (e.g. ext4 or f2fs with the
+ * casefold feature) attach a Unicode encoding at mount time
+ * but apply case folding per directory. The per-file-system
+ * case_insensitive and case_preserving values can therefore
+ * legitimately differ across objects that share the same fsid.
+ * Report FATTR4_HOMOGENEOUS = FALSE on such filesystems to
+ * keep that variation consistent with RFC 8881 Section 5.8.2.16.
+ */
+ return nfsd4_encode_bool(xdr, !sb_has_encoding(args->dentry->d_sb));
+}
+
static __be32 nfsd4_encode_fattr4_filehandle(struct xdr_stream *xdr,
const struct nfsd4_fattr_args *args)
{
@@ -3748,8 +3777,8 @@ static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
[FATTR4_ACLSUPPORT] = nfsd4_encode_fattr4_aclsupport,
[FATTR4_ARCHIVE] = nfsd4_encode_fattr4__noop,
[FATTR4_CANSETTIME] = nfsd4_encode_fattr4__true,
- [FATTR4_CASE_INSENSITIVE] = nfsd4_encode_fattr4__false,
- [FATTR4_CASE_PRESERVING] = nfsd4_encode_fattr4__true,
+ [FATTR4_CASE_INSENSITIVE] = nfsd4_encode_fattr4_case_insensitive,
+ [FATTR4_CASE_PRESERVING] = nfsd4_encode_fattr4_case_preserving,
[FATTR4_CHOWN_RESTRICTED] = nfsd4_encode_fattr4__true,
[FATTR4_FILEHANDLE] = nfsd4_encode_fattr4_filehandle,
[FATTR4_FILEID] = nfsd4_encode_fattr4_fileid,
@@ -3758,7 +3787,7 @@ static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
[FATTR4_FILES_TOTAL] = nfsd4_encode_fattr4_files_total,
[FATTR4_FS_LOCATIONS] = nfsd4_encode_fattr4_fs_locations,
[FATTR4_HIDDEN] = nfsd4_encode_fattr4__noop,
- [FATTR4_HOMOGENEOUS] = nfsd4_encode_fattr4__true,
+ [FATTR4_HOMOGENEOUS] = nfsd4_encode_fattr4_homogeneous,
[FATTR4_MAXFILESIZE] = nfsd4_encode_fattr4_maxfilesize,
[FATTR4_MAXLINK] = nfsd4_encode_fattr4_maxlink,
[FATTR4_MAXNAME] = nfsd4_encode_fattr4_maxname,
@@ -3968,6 +3997,23 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
args.fhp = tempfh;
} else
args.fhp = fhp;
+ if (attrmask[0] & (FATTR4_WORD0_CASE_INSENSITIVE |
+ FATTR4_WORD0_CASE_PRESERVING)) {
+ err = nfsd_get_case_info(dentry, &args.case_insensitive,
+ &args.case_preserving);
+ /*
+ * SUPPORTED_ATTRS unconditionally advertises both
+ * bits, and the Linux client treats an absent
+ * CASE_PRESERVING in a GETATTR reply as false. When
+ * the filesystem does not expose case state,
+ * nfsd_get_case_info() fills POSIX defaults
+ * (case-sensitive, case-preserving) and returns
+ * -EOPNOTSUPP; encode those defaults so the reply
+ * agrees with what the server claims to support.
+ */
+ if (err && err != -EOPNOTSUPP)
+ goto out_nfserr;
+ }
if (attrmask[0] & FATTR4_WORD0_ACL) {
err = nfsd4_get_nfs4_acl(rqstp, dentry, &args.acl);
--
2.53.0
^ permalink raw reply related
* [PATCH v13 13/15] nfsd: Report export case-folding via NFSv3 PATHCONF
From: Chuck Lever @ 2026-05-02 14:20 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
The hard-coded MSDOS_SUPER_MAGIC check in nfsd3_proc_pathconf()
only recognizes FAT filesystems as case-insensitive. Modern
filesystems like F2FS, exFAT, and CIFS support case-insensitive
directories, but NFSv3 clients cannot discover this capability.
Query the export's actual case behavior through ->fileattr_get
instead. This allows NFSv3 clients to correctly handle case
sensitivity for any filesystem that implements the fileattr
interface. Filesystems without ->fileattr_get continue to report
the default POSIX behavior (case-sensitive, case-preserving).
This change depends on the earlier "fat: Implement fileattr_get
for case sensitivity" patch in this series, which ensures FAT
filesystems report their case behavior correctly via the
fileattr interface.
Case-folding is a per-directory property, so
nfsd_get_case_info() queries the parent dentry for
non-directory filehandles. Three inherent corner cases follow:
a single-file export's parent lies outside the exported
subtree, so the LSM hook evaluates against an unexported
directory; a disconnected dentry from fh_verify() has
d_parent == itself, so the file's own attributes are reported
until the dentry connects; and a hardlinked file resolves
through the alias the dcache currently holds, so when the
inode is linked into both case-folded and case-sensitive
directories the reported value tracks whichever parent is
active. These limitations are not addressable without
redefining the protocol attribute as per-parent rather than
per-object.
RFC 1813 restricts PATHCONF errors to NFS3ERR_STALE,
NFS3ERR_BADHANDLE, and NFS3ERR_SERVERFAULT. When an LSM hook
denies the case-folding query on the parent, NFS3ERR_STALE is
the only correct mapping: NFS3ERR_SERVERFAULT misrepresents a
working server as broken, and NFS3ERR_BADHANDLE implies a
decoding failure that did not occur. A client purging the
filehandle on receipt is the desired outcome, since the server
has refused to read attributes through it. Substituting POSIX
defaults instead would let the same handle report
casefold=false now and casefold=true once policy permits,
opening a silent name-collision window on case-insensitive
exports.
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfsd/nfs3proc.c | 36 +++++++++++++++++++++------
fs/nfsd/vfs.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
fs/nfsd/vfs.h | 3 +++
fs/nfsd/xdr3.h | 4 +--
4 files changed, 105 insertions(+), 10 deletions(-)
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 42adc5461db0..62ebc65b8af2 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -710,23 +710,43 @@ nfsd3_proc_pathconf(struct svc_rqst *rqstp)
resp->p_name_max = 255; /* at least */
resp->p_no_trunc = 0;
resp->p_chown_restricted = 1;
- resp->p_case_insensitive = 0;
- resp->p_case_preserving = 1;
+ resp->p_case_insensitive = false;
+ resp->p_case_preserving = true;
resp->status = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP);
if (resp->status == nfs_ok) {
struct super_block *sb = argp->fh.fh_dentry->d_sb;
+ int err;
- /* Note that we don't care for remote fs's here */
- switch (sb->s_magic) {
- case EXT2_SUPER_MAGIC:
+ if (sb->s_magic == EXT2_SUPER_MAGIC) {
resp->p_link_max = EXT2_LINK_MAX;
resp->p_name_max = EXT2_NAME_LEN;
+ }
+
+ err = nfsd_get_case_info(argp->fh.fh_dentry,
+ &resp->p_case_insensitive,
+ &resp->p_case_preserving);
+ /*
+ * RFC 1813 lists NFS3ERR_STALE, NFS3ERR_BADHANDLE, and
+ * NFS3ERR_SERVERFAULT as the only PATHCONF errors.
+ */
+ switch (err) {
+ case 0:
+ case -EOPNOTSUPP:
+ /* Both arms leave the output booleans valid. */
break;
- case MSDOS_SUPER_MAGIC:
- resp->p_case_insensitive = 1;
- resp->p_case_preserving = 0;
+ case -EACCES:
+ case -EPERM:
+ /*
+ * Policy denied the query. Report STALE so the
+ * handle is unusable without implying a server
+ * malfunction.
+ */
+ resp->status = nfserr_stale;
+ break;
+ default:
+ resp->status = nfserr_serverfault;
break;
}
}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index eafdf7b7890f..4bd63d8efbf7 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -32,6 +32,7 @@
#include <linux/writeback.h>
#include <linux/security.h>
#include <linux/sunrpc/xdr.h>
+#include <linux/fileattr.h>
#include "xdr3.h"
@@ -2891,3 +2892,74 @@ nfsd_permission(struct svc_cred *cred, struct svc_export *exp,
return err? nfserrno(err) : 0;
}
+
+/**
+ * nfsd_get_case_info - get case sensitivity info for a dentry
+ * @dentry: dentry to query
+ * @case_insensitive: set to true if the filesystem is case-insensitive
+ * @case_preserving: set to true if the filesystem preserves case
+ *
+ * On casefold-capable filesystems the flag lives on the directory,
+ * not on its entries, so for a non-directory @dentry the parent is
+ * queried instead. A directory (including an export root, whose
+ * parent lies outside the export) is queried as-is so its own
+ * contents' lookup behavior is reported.
+ *
+ * When the filesystem does not expose case-folding state (no
+ * ->fileattr_get, or the callback returns -EOPNOTSUPP /
+ * -ENOIOCTLCMD / -ENOTTY / -EINVAL), the outputs are filled with
+ * POSIX defaults (case-sensitive, case-preserving) on the premise
+ * that a filesystem with case-folding support wires up
+ * fileattr_get.
+ *
+ * Other errors propagate unmodified (-EACCES, -EPERM from LSM
+ * hooks; -EIO, -ESTALE, ... from the filesystem). Case-folding
+ * behavior is a property of the exported filesystem, not of the
+ * caller's credentials, so silently substituting defaults would
+ * let the same dentry report POSIX while LSM denies and report
+ * casefolding once LSM allows -- a client could race against
+ * silent name collisions on a case-insensitive export.
+ *
+ * Return: 0 with outputs filled, -EOPNOTSUPP with outputs filled
+ * to POSIX defaults, or a negative errno with outputs
+ * unmodified.
+ */
+int
+nfsd_get_case_info(struct dentry *dentry, bool *case_insensitive,
+ bool *case_preserving)
+{
+ struct file_kattr fa = {};
+ struct dentry *cd;
+ bool put = false;
+ int err;
+
+ if (d_is_dir(dentry)) {
+ cd = dentry;
+ } else {
+ cd = dget_parent(dentry);
+ put = true;
+ }
+ err = vfs_fileattr_get(cd, &fa);
+ if (put)
+ dput(cd);
+ switch (err) {
+ case 0:
+ *case_insensitive = fa.fsx_xflags & FS_XFLAG_CASEFOLD;
+ *case_preserving =
+ !(fa.fsx_xflags & FS_XFLAG_CASENONPRESERVING);
+ return 0;
+ case -EINVAL:
+ case -ENOTTY:
+ case -ENOIOCTLCMD:
+ case -EOPNOTSUPP:
+ /*
+ * Filesystem does not expose case state.
+ * Report POSIX defaults.
+ */
+ *case_insensitive = false;
+ *case_preserving = true;
+ return -EOPNOTSUPP;
+ default:
+ return err;
+ }
+}
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
index 702a844f2106..e09ea04a51b9 100644
--- a/fs/nfsd/vfs.h
+++ b/fs/nfsd/vfs.h
@@ -156,6 +156,9 @@ __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
loff_t *, struct readdir_cd *, nfsd_filldir_t);
__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
struct kstatfs *, int access);
+int nfsd_get_case_info(struct dentry *dentry,
+ bool *case_insensitive,
+ bool *case_preserving);
__be32 nfsd_permission(struct svc_cred *cred, struct svc_export *exp,
struct dentry *dentry, int acc);
diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h
index 522067b7fd75..a7c9714b0b0e 100644
--- a/fs/nfsd/xdr3.h
+++ b/fs/nfsd/xdr3.h
@@ -209,8 +209,8 @@ struct nfsd3_pathconfres {
__u32 p_name_max;
__u32 p_no_trunc;
__u32 p_chown_restricted;
- __u32 p_case_insensitive;
- __u32 p_case_preserving;
+ bool p_case_insensitive;
+ bool p_case_preserving;
};
struct nfsd3_commitres {
--
2.53.0
^ permalink raw reply related
* [PATCH v13 12/15] isofs: Implement fileattr_get for case sensitivity
From: Chuck Lever @ 2026-05-02 14:20 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
Upper layers such as NFSD need a way to query whether a
filesystem handles filenames in a case-sensitive manner so
they can provide correct semantics to remote clients. Without
this information, NFS exports of ISO 9660 filesystems cannot
advertise their filename case behavior.
Implement isofs_fileattr_get() to report ISO 9660 case handling
behavior. The 'check=r' (relaxed) mount option enables
case-insensitive lookups and is reported via FS_XFLAG_CASEFOLD.
By default, Joliet extensions operate in relaxed mode while
plain ISO 9660 uses strict (case-sensitive) mode.
Plain ISO 9660 names on the medium are uppercase. When neither
Rock Ridge nor Joliet is in effect, the default 'map=n' option
(and 'map=a') routes lookup and readdir through
isofs_name_translate(), which forces A-Z to a-z. The names
visible to userspace then differ in case from the on-disc form,
so report FS_XFLAG_CASENONPRESERVING in that configuration. Rock
Ridge and Joliet both deliver names as authored, and 'map=o'
emits the raw on-disc name unchanged, so those configurations
remain case-preserving.
Casefolding is a directory property, and the in-tree consumers
(NFSD, ksmbd) issue the query against a directory: NFSD walks
to the parent for non-directory dentries before calling
vfs_fileattr_get(), and ksmbd reports per-share attributes from
the share root. Wire .fileattr_get only on
isofs_dir_inode_operations. The CASEFOLD flag is set in both
fa->fsx_xflags and fa->flags so FS_IOC_FSGETXATTR and
FS_IOC_GETFLAGS agree.
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/isofs/dir.c | 16 ++++++++++++++++
fs/isofs/isofs.h | 3 +++
2 files changed, 19 insertions(+)
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index 2fd9948d606e..55385a72a4ce 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -14,6 +14,7 @@
#include <linux/gfp.h>
#include <linux/filelock.h>
#include "isofs.h"
+#include <linux/fileattr.h>
int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode)
{
@@ -267,6 +268,20 @@ static int isofs_readdir(struct file *file, struct dir_context *ctx)
return result;
}
+int isofs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
+{
+ struct isofs_sb_info *sbi = ISOFS_SB(dentry->d_sb);
+
+ if (sbi->s_check == 'r') {
+ fa->fsx_xflags |= FS_XFLAG_CASEFOLD;
+ fa->flags |= FS_CASEFOLD_FL;
+ }
+ if (!sbi->s_joliet_level && !sbi->s_rock &&
+ (sbi->s_mapping == 'n' || sbi->s_mapping == 'a'))
+ fa->fsx_xflags |= FS_XFLAG_CASENONPRESERVING;
+ return 0;
+}
+
const struct file_operations isofs_dir_operations =
{
.llseek = generic_file_llseek,
@@ -281,6 +296,7 @@ const struct file_operations isofs_dir_operations =
const struct inode_operations isofs_dir_inode_operations =
{
.lookup = isofs_lookup,
+ .fileattr_get = isofs_fileattr_get,
};
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index 506555837533..0ec8b24a42ed 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -197,6 +197,9 @@ isofs_normalize_block_and_offset(struct iso_directory_record* de,
}
}
+struct file_kattr;
+int isofs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
+
extern const struct inode_operations isofs_dir_inode_operations;
extern const struct file_operations isofs_dir_operations;
extern const struct address_space_operations isofs_symlink_aops;
--
2.53.0
^ permalink raw reply related
* [PATCH v13 11/15] vboxsf: Implement fileattr_get for case sensitivity
From: Chuck Lever @ 2026-05-02 14:20 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
Upper layers such as NFSD need a way to query whether a
filesystem handles filenames in a case-sensitive manner. Report
VirtualBox shared folder case handling behavior via the
FS_XFLAG_CASEFOLD flag.
The case sensitivity property is queried from the VirtualBox host
service at mount time and cached in struct vboxsf_sbi. The host
determines case sensitivity based on the underlying host filesystem
(for example, Windows NTFS is case-insensitive while Linux ext4 is
case-sensitive).
VirtualBox shared folders always preserve filename case exactly
as provided by the guest. The host interface does not expose a
separate case-preserving property; leaving
FS_XFLAG_CASENONPRESERVING unset reports the POSIX-default
case-preserving behavior, which matches vboxsf semantics.
The callback is registered in all three inode_operations
structures (directory, file, and symlink) to ensure consistent
reporting across all inode types.
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/vboxsf/dir.c | 1 +
fs/vboxsf/file.c | 6 ++++--
fs/vboxsf/super.c | 7 +++++++
fs/vboxsf/utils.c | 30 ++++++++++++++++++++++++++++++
fs/vboxsf/vfsmod.h | 6 ++++++
5 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/fs/vboxsf/dir.c b/fs/vboxsf/dir.c
index 42bedc4ec7af..c5bd3271aa96 100644
--- a/fs/vboxsf/dir.c
+++ b/fs/vboxsf/dir.c
@@ -477,4 +477,5 @@ const struct inode_operations vboxsf_dir_iops = {
.symlink = vboxsf_dir_symlink,
.getattr = vboxsf_getattr,
.setattr = vboxsf_setattr,
+ .fileattr_get = vboxsf_fileattr_get,
};
diff --git a/fs/vboxsf/file.c b/fs/vboxsf/file.c
index 7a7a3fbb2651..943953867e18 100644
--- a/fs/vboxsf/file.c
+++ b/fs/vboxsf/file.c
@@ -222,7 +222,8 @@ const struct file_operations vboxsf_reg_fops = {
const struct inode_operations vboxsf_reg_iops = {
.getattr = vboxsf_getattr,
- .setattr = vboxsf_setattr
+ .setattr = vboxsf_setattr,
+ .fileattr_get = vboxsf_fileattr_get,
};
static int vboxsf_read_folio(struct file *file, struct folio *folio)
@@ -389,5 +390,6 @@ static const char *vboxsf_get_link(struct dentry *dentry, struct inode *inode,
}
const struct inode_operations vboxsf_lnk_iops = {
- .get_link = vboxsf_get_link
+ .get_link = vboxsf_get_link,
+ .fileattr_get = vboxsf_fileattr_get,
};
diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
index a618cb093e00..a61fbab51d37 100644
--- a/fs/vboxsf/super.c
+++ b/fs/vboxsf/super.c
@@ -185,6 +185,13 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
if (err)
goto fail_unmap;
+ /*
+ * A failed query leaves sbi->case_insensitive false, so the
+ * mount defaults to reporting case-sensitive behavior. Do not
+ * fail the mount over an advisory attribute.
+ */
+ vboxsf_query_case_sensitive(sbi);
+
sb->s_magic = VBOXSF_SUPER_MAGIC;
sb->s_blocksize = 1024;
sb->s_maxbytes = MAX_LFS_FILESIZE;
diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c
index 440e8c50629d..298bfc93255c 100644
--- a/fs/vboxsf/utils.c
+++ b/fs/vboxsf/utils.c
@@ -11,6 +11,7 @@
#include <linux/sizes.h>
#include <linux/pagemap.h>
#include <linux/vfs.h>
+#include <linux/fileattr.h>
#include "vfsmod.h"
struct inode *vboxsf_new_inode(struct super_block *sb)
@@ -567,3 +568,32 @@ int vboxsf_dir_read_all(struct vboxsf_sbi *sbi, struct vboxsf_dir_info *sf_d,
return err;
}
+
+int vboxsf_query_case_sensitive(struct vboxsf_sbi *sbi)
+{
+ struct shfl_volinfo volinfo = {};
+ u32 buf_len;
+ int err;
+
+ buf_len = sizeof(volinfo);
+ err = vboxsf_fsinfo(sbi->root, 0, SHFL_INFO_GET | SHFL_INFO_VOLUME,
+ &buf_len, &volinfo);
+ if (err)
+ return err;
+ if (buf_len < sizeof(volinfo))
+ return 0;
+
+ sbi->case_insensitive = !volinfo.properties.case_sensitive;
+ return 0;
+}
+
+int vboxsf_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
+{
+ struct vboxsf_sbi *sbi = VBOXSF_SBI(dentry->d_sb);
+
+ if (sbi->case_insensitive) {
+ fa->fsx_xflags |= FS_XFLAG_CASEFOLD;
+ fa->flags |= FS_CASEFOLD_FL;
+ }
+ return 0;
+}
diff --git a/fs/vboxsf/vfsmod.h b/fs/vboxsf/vfsmod.h
index 05973eb89d52..b61afd0ce842 100644
--- a/fs/vboxsf/vfsmod.h
+++ b/fs/vboxsf/vfsmod.h
@@ -47,6 +47,7 @@ struct vboxsf_sbi {
u32 next_generation;
u32 root;
int bdi_id;
+ bool case_insensitive;
};
/* per-inode information */
@@ -111,6 +112,11 @@ void vboxsf_dir_info_free(struct vboxsf_dir_info *p);
int vboxsf_dir_read_all(struct vboxsf_sbi *sbi, struct vboxsf_dir_info *sf_d,
u64 handle);
+int vboxsf_query_case_sensitive(struct vboxsf_sbi *sbi);
+
+struct file_kattr;
+int vboxsf_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
+
/* from vboxsf_wrappers.c */
int vboxsf_connect(void);
void vboxsf_disconnect(void);
--
2.53.0
^ permalink raw reply related
* [PATCH v13 10/15] nfs: Implement fileattr_get for case sensitivity
From: Chuck Lever @ 2026-05-02 14:20 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
An NFS server re-exporting an NFS mount point needs to report
the case sensitivity behavior of the underlying filesystem to
its clients. NFSD's attribute encoder obtains that information
by calling vfs_fileattr_get() on the lower filesystem, so the
NFS client must implement fileattr_get to surface what it
learned from its own server.
The NFS client already retrieves case sensitivity information
from servers during mount via PATHCONF (NFSv3) or the
FATTR4_CASE_INSENSITIVE/FATTR4_CASE_PRESERVING attributes
(NFSv4). Expose this information through fileattr_get by
reporting the FS_XFLAG_CASEFOLD and FS_XFLAG_CASENONPRESERVING
flags. NFSv2 lacks PATHCONF support, so mounts using that protocol
version default to standard POSIX behavior: case-sensitive and
case-preserving.
PATHCONF is now invoked unconditionally for NFSv2 and NFSv3 mounts
so the case-sensitivity capabilities are established even when the
user pins server->namelen with the namlen= mount option. That option
is orthogonal to case handling, and skipping PATHCONF because
namelen was already known would leave the caps unset.
The two capability bits carry opposite polarity because their POSIX
defaults differ. Most servers are case-sensitive and case-
preserving, matching "neither xflag set." NFS_CAP_CASE_INSENSITIVE
is set only when the server affirms case insensitivity, so "server
said no" and "server did not answer" both collapse to the case-
sensitive default. NFS_CAP_CASE_NONPRESERVING follows the same
pattern in the opposite direction: set only when the server affirms
that it does not preserve case, so that silence or a missing
attribute lands on the case-preserving default. The NFSv4 probe
checks res.attr_bitmask[0] to distinguish "server said false" from
"server omitted the attribute" before setting the bit.
Both capability bits are cleared before each probe so a remount,
an NFSv4 transparent state migration to a server with different
case semantics, or a probe whose reply does not arrive does not
retain stale capabilities from the prior probe.
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfs/client.c | 21 +++++++++++++++------
fs/nfs/inode.c | 15 +++++++++++++++
fs/nfs/internal.h | 3 +++
fs/nfs/namespace.c | 2 ++
fs/nfs/nfs3proc.c | 2 ++
fs/nfs/nfs3xdr.c | 7 +++++--
fs/nfs/nfs4proc.c | 10 +++++++---
fs/nfs/proc.c | 3 +++
fs/nfs/symlink.c | 3 +++
include/linux/nfs_fs_sb.h | 2 +-
include/linux/nfs_xdr.h | 2 ++
11 files changed, 58 insertions(+), 12 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index be02bb227741..3db2f18315b8 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -914,6 +914,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,
*/
static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs_fattr *fattr)
{
+ struct nfs_pathconf pathinfo = { };
struct nfs_fsinfo fsinfo;
struct nfs_client *clp = server->nfs_client;
int error;
@@ -933,15 +934,23 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
nfs_server_set_fsinfo(server, &fsinfo);
- /* Get some general file system info */
- if (server->namelen == 0) {
- struct nfs_pathconf pathinfo;
+ pathinfo.fattr = fattr;
+ nfs_fattr_init(fattr);
- pathinfo.fattr = fattr;
- nfs_fattr_init(fattr);
+ /* Clear before probing so a failed RPC does not retain stale bits. */
+ if (clp->rpc_ops->version < 4)
+ server->caps &= ~(NFS_CAP_CASE_INSENSITIVE |
+ NFS_CAP_CASE_NONPRESERVING);
- if (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >= 0)
+ if (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >= 0) {
+ if (server->namelen == 0)
server->namelen = pathinfo.max_namelen;
+ if (clp->rpc_ops->version < 4) {
+ if (pathinfo.case_insensitive)
+ server->caps |= NFS_CAP_CASE_INSENSITIVE;
+ if (!pathinfo.case_preserving)
+ server->caps |= NFS_CAP_CASE_NONPRESERVING;
+ }
}
if (clp->rpc_ops->discover_trunking != NULL &&
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 98a8f0de1199..fdcbe6f2052c 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -41,6 +41,7 @@
#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/iversion.h>
+#include <linux/fileattr.h>
#include "nfs4_fs.h"
#include "callback.h"
@@ -1101,6 +1102,20 @@ int nfs_getattr(struct mnt_idmap *idmap, const struct path *path,
}
EXPORT_SYMBOL_GPL(nfs_getattr);
+int nfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
+{
+ struct inode *inode = d_inode(dentry);
+
+ if (nfs_server_capable(inode, NFS_CAP_CASE_INSENSITIVE)) {
+ fa->fsx_xflags |= FS_XFLAG_CASEFOLD;
+ fa->flags |= FS_CASEFOLD_FL;
+ }
+ if (nfs_server_capable(inode, NFS_CAP_CASE_NONPRESERVING))
+ fa->fsx_xflags |= FS_XFLAG_CASENONPRESERVING;
+ return 0;
+}
+EXPORT_SYMBOL_GPL(nfs_fileattr_get);
+
static void nfs_init_lock_context(struct nfs_lock_context *l_ctx)
{
refcount_set(&l_ctx->count, 1);
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index fc5456377160..309d3f679bb3 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -449,6 +449,9 @@ extern void nfs_set_cache_invalid(struct inode *inode, unsigned long flags);
extern bool nfs_check_cache_invalid(struct inode *, unsigned long);
extern int nfs_wait_bit_killable(struct wait_bit_key *key, int mode);
+struct file_kattr;
+int nfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
+
#if IS_ENABLED(CONFIG_NFS_LOCALIO)
/* localio.c */
struct nfs_local_dio {
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index af9be0c5f516..6d0073c24771 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -246,11 +246,13 @@ nfs_namespace_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
const struct inode_operations nfs_mountpoint_inode_operations = {
.getattr = nfs_getattr,
.setattr = nfs_setattr,
+ .fileattr_get = nfs_fileattr_get,
};
const struct inode_operations nfs_referral_inode_operations = {
.getattr = nfs_namespace_getattr,
.setattr = nfs_namespace_setattr,
+ .fileattr_get = nfs_fileattr_get,
};
static void nfs_expire_automounts(struct work_struct *work)
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 95d7cd564b74..b80d0c5efc27 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -1053,6 +1053,7 @@ static const struct inode_operations nfs3_dir_inode_operations = {
.permission = nfs_permission,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
+ .fileattr_get = nfs_fileattr_get,
#ifdef CONFIG_NFS_V3_ACL
.listxattr = nfs3_listxattr,
.get_inode_acl = nfs3_get_acl,
@@ -1064,6 +1065,7 @@ static const struct inode_operations nfs3_file_inode_operations = {
.permission = nfs_permission,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
+ .fileattr_get = nfs_fileattr_get,
#ifdef CONFIG_NFS_V3_ACL
.listxattr = nfs3_listxattr,
.get_inode_acl = nfs3_get_acl,
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index e17d72908412..e745e78faab0 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -2276,8 +2276,11 @@ static int decode_pathconf3resok(struct xdr_stream *xdr,
if (unlikely(!p))
return -EIO;
result->max_link = be32_to_cpup(p++);
- result->max_namelen = be32_to_cpup(p);
- /* ignore remaining fields */
+ result->max_namelen = be32_to_cpup(p++);
+ p++; /* ignore no_trunc */
+ p++; /* ignore chown_restricted */
+ result->case_insensitive = be32_to_cpup(p++) != 0;
+ result->case_preserving = be32_to_cpup(p) != 0;
return 0;
}
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d839a97df822..62f66684fbc8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3933,7 +3933,8 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
server->caps &=
~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS | NFS_CAP_SYMLINKS |
NFS_CAP_SECURITY_LABEL | NFS_CAP_FS_LOCATIONS |
- NFS_CAP_OPEN_XOR | NFS_CAP_DELEGTIME);
+ NFS_CAP_OPEN_XOR | NFS_CAP_DELEGTIME |
+ NFS_CAP_CASE_INSENSITIVE | NFS_CAP_CASE_NONPRESERVING);
server->fattr_valid = NFS_ATTR_FATTR_V4;
if (res.attr_bitmask[0] & FATTR4_WORD0_ACL &&
res.acl_bitmask & ACL4_SUPPORT_ALLOW_ACL)
@@ -3944,8 +3945,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
server->caps |= NFS_CAP_SYMLINKS;
if (res.case_insensitive)
server->caps |= NFS_CAP_CASE_INSENSITIVE;
- if (res.case_preserving)
- server->caps |= NFS_CAP_CASE_PRESERVING;
+ if ((res.attr_bitmask[0] & FATTR4_WORD0_CASE_PRESERVING) &&
+ !res.case_preserving)
+ server->caps |= NFS_CAP_CASE_NONPRESERVING;
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
if (res.attr_bitmask[2] & FATTR4_WORD2_SECURITY_LABEL)
server->caps |= NFS_CAP_SECURITY_LABEL;
@@ -10598,6 +10600,7 @@ static const struct inode_operations nfs4_dir_inode_operations = {
.getattr = nfs_getattr,
.setattr = nfs_setattr,
.listxattr = nfs4_listxattr,
+ .fileattr_get = nfs_fileattr_get,
};
static const struct inode_operations nfs4_file_inode_operations = {
@@ -10605,6 +10608,7 @@ static const struct inode_operations nfs4_file_inode_operations = {
.getattr = nfs_getattr,
.setattr = nfs_setattr,
.listxattr = nfs4_listxattr,
+ .fileattr_get = nfs_fileattr_get,
};
static struct nfs_server *nfs4_clone_server(struct nfs_server *source,
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 70795684b8e8..03c2c1f31be9 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -598,6 +598,7 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
{
info->max_link = 0;
info->max_namelen = NFS2_MAXNAMLEN;
+ info->case_preserving = true;
return 0;
}
@@ -718,12 +719,14 @@ static const struct inode_operations nfs_dir_inode_operations = {
.permission = nfs_permission,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
+ .fileattr_get = nfs_fileattr_get,
};
static const struct inode_operations nfs_file_inode_operations = {
.permission = nfs_permission,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
+ .fileattr_get = nfs_fileattr_get,
};
const struct nfs_rpc_ops nfs_v2_clientops = {
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c
index 58146e935402..74a072896f8d 100644
--- a/fs/nfs/symlink.c
+++ b/fs/nfs/symlink.c
@@ -22,6 +22,8 @@
#include <linux/mm.h>
#include <linux/string.h>
+#include "internal.h"
+
/* Symlink caching in the page cache is even more simplistic
* and straight-forward than readdir caching.
*/
@@ -74,4 +76,5 @@ const struct inode_operations nfs_symlink_inode_operations = {
.get_link = nfs_get_link,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
+ .fileattr_get = nfs_fileattr_get,
};
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 4daee27fa5eb..34d294774f8c 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -306,7 +306,7 @@ struct nfs_server {
#define NFS_CAP_ATOMIC_OPEN (1U << 4)
#define NFS_CAP_LGOPEN (1U << 5)
#define NFS_CAP_CASE_INSENSITIVE (1U << 6)
-#define NFS_CAP_CASE_PRESERVING (1U << 7)
+#define NFS_CAP_CASE_NONPRESERVING (1U << 7)
#define NFS_CAP_REBOOT_LAYOUTRETURN (1U << 8)
#define NFS_CAP_OFFLOAD_STATUS (1U << 9)
#define NFS_CAP_ZERO_RANGE (1U << 10)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index ff1f12aa73d2..7c2057e40f99 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -182,6 +182,8 @@ struct nfs_pathconf {
struct nfs_fattr *fattr; /* Post-op attributes */
__u32 max_link; /* max # of hard links */
__u32 max_namelen; /* max name length */
+ bool case_insensitive;
+ bool case_preserving;
};
struct nfs4_change_info {
--
2.53.0
^ permalink raw reply related
* [PATCH v13 09/15] cifs: Implement fileattr_get for case sensitivity
From: Chuck Lever @ 2026-05-02 14:20 UTC (permalink / raw)
To: Al Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-ext4, linux-xfs, linux-cifs, linux-nfs,
linux-api, linux-f2fs-devel, hirofumi, linkinjeon, sj1557.seo,
yuezhang.mo, almaz.alexandrovich, slava, glaubitz, frank.li,
tytso, adilger.kernel, cem, sfrench, pc, ronniesahlberg, sprasad,
trondmy, anna, jaegeuk, chao, hansg, senozhatsky, Chuck Lever,
Steve French, Roland Mainz
In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com>
From: Chuck Lever <chuck.lever@oracle.com>
Upper layers such as NFSD need a way to query whether a filesystem
handles filenames in a case-sensitive manner. Report CIFS/SMB case
handling behavior via FS_XFLAG_CASEFOLD and
FS_XFLAG_CASENONPRESERVING.
The authoritative source is the server itself: at mount time CIFS
issues QueryFSInfo(FS_ATTRIBUTE_INFORMATION) and caches the reply
on the tcon. That reply carries FILE_CASE_SENSITIVE_SEARCH and
FILE_CASE_PRESERVED_NAMES, which reflect whatever case handling
the share actually implements after SMB3.1.1 POSIX extensions
negotiation. Translating those two bits into the VFS flags lets
cifs_fileattr_get report what the server advertises rather than
what the client was asked to pretend.
QueryFSInfo is best-effort; the mount completes even if the server
does not answer. MaxPathNameComponentLength is zero in that case
and is used as the "no reply received" sentinel. When no reply is
available, fall back to the nocase mount option so that the reported
behavior agrees with the dentry comparison operations installed on
the superblock.
The callback is registered on cifs_dir_inode_ops so that NFSD,
ksmbd, and other consumers querying case handling against a
directory get a definitive answer, and on cifs_file_inode_ops to
preserve FS_COMPR_FL reporting on regular files. cifs_set_ops()
also installs cifs_namespace_inode_operations on DFS referral
directories that carry IS_AUTOMOUNT; register the same callback
there so the answer does not depend on whether the directory is
a referral point.
Registering fileattr_get routes FS_IOC_GETFLAGS through
vfs_fileattr_get() and short-circuits the syscall's fallback to
cifs_ioctl(). That fallback invoked CIFSGetExtAttr() under
CONFIG_CIFS_POSIX and CONFIG_CIFS_ALLOW_INSECURE_LEGACY on servers
advertising CIFS_UNIX_EXTATTR_CAP, surfacing the SMB1 Unix-extension
immutable, append, and nodump bits. cifs_fileattr_get carries over
only FS_COMPR_FL from cached cifsAttrs; the SMB1 extattr fetch is
not reproduced. SMB1 is deprecated, and acquiring a netfid from
within a dentry-only callback is not worth preserving a path tied
to an insecure legacy dialect.
Acked-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/smb/client/cifsfs.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++
fs/smb/client/cifsfs.h | 3 +++
fs/smb/client/namespace.c | 1 +
3 files changed, 57 insertions(+)
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 2025739f070a..6c113ae7fdd3 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -30,6 +30,7 @@
#include <linux/xattr.h>
#include <linux/mm.h>
#include <linux/key-type.h>
+#include <linux/fileattr.h>
#include <uapi/linux/magic.h>
#include <net/ipv6.h>
#include "cifsfs.h"
@@ -1199,6 +1200,56 @@ struct file_system_type smb3_fs_type = {
MODULE_ALIAS_FS("smb3");
MODULE_ALIAS("smb3");
+int cifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
+{
+ struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb);
+ struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
+ struct inode *inode = d_inode(dentry);
+ u32 attrs;
+
+ /* Preserve FS_COMPR_FL previously reported by cifs_ioctl(). */
+ if (CIFS_I(inode)->cifsAttrs & ATTR_COMPRESSED)
+ fa->flags |= FS_COMPR_FL;
+
+ /*
+ * FS_CASEFOLD_FL is defined by UAPI as a folder attribute,
+ * and userspace tools (e.g., lsattr) display it only on
+ * directories. Confine the case-handling bits to directories
+ * to match that convention; for non-directories the share's
+ * case semantics are still discoverable through the parent.
+ */
+ if (!S_ISDIR(inode->i_mode))
+ return 0;
+
+ /*
+ * The server's FS_ATTRIBUTE_INFORMATION response, cached on
+ * the tcon at mount, reflects the share's case-handling
+ * semantics after any POSIX extensions negotiation. Prefer
+ * it over the client-local nocase mount option, which only
+ * governs dentry comparison on this superblock.
+ *
+ * QueryFSInfo is best-effort at mount; when it did not
+ * populate fsAttrInfo, MaxPathNameComponentLength remains
+ * zero. In that case fall back to nocase so the reporting
+ * matches the comparison behavior installed on the sb.
+ */
+ if (le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength) == 0) {
+ if (tcon->nocase) {
+ fa->fsx_xflags |= FS_XFLAG_CASEFOLD;
+ fa->flags |= FS_CASEFOLD_FL;
+ }
+ return 0;
+ }
+ attrs = le32_to_cpu(tcon->fsAttrInfo.Attributes);
+ if (!(attrs & FILE_CASE_SENSITIVE_SEARCH)) {
+ fa->fsx_xflags |= FS_XFLAG_CASEFOLD;
+ fa->flags |= FS_CASEFOLD_FL;
+ }
+ if (!(attrs & FILE_CASE_PRESERVED_NAMES))
+ fa->fsx_xflags |= FS_XFLAG_CASENONPRESERVING;
+ return 0;
+}
+
const struct inode_operations cifs_dir_inode_ops = {
.create = cifs_create,
.atomic_open = cifs_atomic_open,
@@ -1217,6 +1268,7 @@ const struct inode_operations cifs_dir_inode_ops = {
.listxattr = cifs_listxattr,
.get_acl = cifs_get_acl,
.set_acl = cifs_set_acl,
+ .fileattr_get = cifs_fileattr_get,
};
const struct inode_operations cifs_file_inode_ops = {
@@ -1227,6 +1279,7 @@ const struct inode_operations cifs_file_inode_ops = {
.fiemap = cifs_fiemap,
.get_acl = cifs_get_acl,
.set_acl = cifs_set_acl,
+ .fileattr_get = cifs_fileattr_get,
};
const char *cifs_get_link(struct dentry *dentry, struct inode *inode,
diff --git a/fs/smb/client/cifsfs.h b/fs/smb/client/cifsfs.h
index 7370b38da938..5f0d459d1a89 100644
--- a/fs/smb/client/cifsfs.h
+++ b/fs/smb/client/cifsfs.h
@@ -89,6 +89,9 @@ extern const struct inode_operations cifs_file_inode_ops;
extern const struct inode_operations cifs_symlink_inode_ops;
extern const struct inode_operations cifs_namespace_inode_operations;
+struct file_kattr;
+int cifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
+
/* Functions related to files and directories */
extern const struct netfs_request_ops cifs_req_ops;
diff --git a/fs/smb/client/namespace.c b/fs/smb/client/namespace.c
index 52a520349cb7..52a51b032fae 100644
--- a/fs/smb/client/namespace.c
+++ b/fs/smb/client/namespace.c
@@ -294,4 +294,5 @@ struct vfsmount *cifs_d_automount(struct path *path)
}
const struct inode_operations cifs_namespace_inode_operations = {
+ .fileattr_get = cifs_fileattr_get,
};
--
2.53.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox