All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	fuse-devel <fuse-devel@lists.linux.dev>
Subject: Re: [PATCH 0/7] fix up issues from djwong/fuse4fs-fork
Date: Wed, 6 May 2026 17:08:33 +0200	[thread overview]
Message-ID: <20260506150833.GD49070@macsyma.local> (raw)
In-Reply-To: <20260506143413.GA2241589@frogsfrogsfrogs>

On Wed, May 06, 2026 at 07:34:13AM -0700, Darrick J. Wong wrote:
> [cc fuse-devel]
> 
> TLDR for the fuse developers: Ted and I discovered a collision between
> the upstream libfuse feature bits and the MacFUSE feature bits, which
> causes macfuse to do the wrong thing if you try to enable symlink
> pagecache.

This is the patch for fuse2fs and fuse4fs in e2fsprogs which works
around the problem (tested on MacOS using macfuse 5.2.0_1 from
MacPorts).  More details about why it was needed is in the commit
description.

					- Ted

From 67f1ec55a1309abead16cad883e38b798a567191 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Wed, 6 May 2026 10:51:56 -0400
Subject: [PATCH] fuse2fs, fuse4fs: Fix MacFuse compatibility issue

Unfortunately, MacFuse is overloading the top bits of the flags field
in struct fuse_init_{out} for MacFuse-specific capability extensions.
This results in an attempt to use FUSE_CAP_CACHE_SYMLINKS when linking
with the libfuse in MacPorts will end up enabling
FUSE_DARWIN_CAP_ACCESS_EXT with MacFuse.  Hilarity then ensues with
all non-privileged access failing with permission denied.

The change which is needed in MacFuse is described in a TODO(bf)
statement:

https://github.com/macfuse/library/blob/ddb630db8327a50b6670ef5e4f5e6da82a549e99/lib/fuse_lowlevel.c#L3415

I plan to submit a bug report to MacFuse, but in the mean time, work around
the problem by disabling the overloaded capability flags on MacOS.

Link: https://lore.kernel.org/r/20260505225635.GT7765@frogsfrogsfrogs
Link: https://lore.kernel.org/r/20260506092858.GC49070@macsyma.local
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 fuse4fs/fuse4fs.c | 18 ++++++++++++++++++
 misc/fuse2fs.c    | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index 92847326..2739da92 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -120,6 +120,24 @@
 #endif
 #endif /* !defined(ENODATA) */
 
+#ifdef __APPLE__
+/*
+ * Sigh.... MacFuse is overloading the top bits of the flags field in
+ * struct fuse_init_{out} for MacFuse-specific capability extensions.
+ * Avoid using these fuse3 capability flags until this gets fixed in
+ * MacFUSE
+ */
+#undef FUSE_CAP_CACHE_SYMLINKS
+#undef FUSE_CAP_NO_OPENDIR_SUPPORT
+#undef FUSE_CAP_EXPLICIT_INVAL_DATA
+#undef FUSE_CAP_EXPIRE_ONLY
+#undef FUSE_CAP_SETXATTR_EXT
+#undef FUSE_CAP_DIRECT_IO_ALLOW_MMAP
+#undef FUSE_CAP_PASSTHROUGH
+#undef FUSE_CAP_NO_EXPORT_SUPPORT
+#undef FUSE_CAP_OVER_IO_URING
+#endif
+
 #define FUSE4FS_ATTR_TIMEOUT	(0.0)
 
 static inline uint64_t round_up(uint64_t b, unsigned int align)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index c46cfc23..0f2a3c35 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -116,6 +116,24 @@
 #endif
 #endif /* !defined(ENODATA) */
 
+#ifdef __APPLE__
+/*
+ * Sigh.... MacFuse is overloading the top bits of the flags field in
+ * struct fuse_init_{out} for MacFuse-specific capability extensions.
+ * Avoid using these fuse3 capability flags until this gets fixed in
+ * MacFUSE
+ */
+#undef FUSE_CAP_CACHE_SYMLINKS
+#undef FUSE_CAP_NO_OPENDIR_SUPPORT
+#undef FUSE_CAP_EXPLICIT_INVAL_DATA
+#undef FUSE_CAP_EXPIRE_ONLY
+#undef FUSE_CAP_SETXATTR_EXT
+#undef FUSE_CAP_DIRECT_IO_ALLOW_MMAP
+#undef FUSE_CAP_PASSTHROUGH
+#undef FUSE_CAP_NO_EXPORT_SUPPORT
+#undef FUSE_CAP_OVER_IO_URING
+#endif
+
 static inline uint64_t round_up(uint64_t b, unsigned int align)
 {
 	unsigned int m;
-- 
2.50.1 (Apple Git-155)


  reply	other threads:[~2026-05-06 15:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 23:32 [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Theodore Ts'o
2026-05-04 23:32 ` [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary Theodore Ts'o
2026-05-05  0:11   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path Theodore Ts'o
2026-05-05  0:13   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 3/7] libsupport: don't use bzero in cache.c Theodore Ts'o
2026-05-05  0:15   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI Theodore Ts'o
2026-05-05  0:20   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h Theodore Ts'o
2026-05-05  0:20   ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 6/7] libsupport: fix gcc -Wall warnings Theodore Ts'o
2026-05-05  0:20   ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 7/7] fuse2fs: fix uninitialized variable warnings Theodore Ts'o
2026-05-05  0:26   ` Darrick J. Wong
2026-05-05  0:08 ` [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Darrick J. Wong
2026-05-05  7:21   ` Theodore Tso
2026-05-05 15:58     ` Darrick J. Wong
2026-05-05 22:04       ` Theodore Tso
2026-05-05 22:56         ` Darrick J. Wong
2026-05-06  9:28           ` Theodore Tso
2026-05-06 14:34             ` Darrick J. Wong
2026-05-06 15:08               ` Theodore Tso [this message]
2026-05-06 16:39                 ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260506150833.GD49070@macsyma.local \
    --to=tytso@mit.edu \
    --cc=djwong@kernel.org \
    --cc=fuse-devel@lists.linux.dev \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.