public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PULLBOMB v3 1.48] fuse4fs: drop libfuse2, add new server
@ 2026-04-09 20:13 Darrick J. Wong
  2026-04-09 20:14 ` [GIT PULL 1/2] fuse2fs: upgrade to libfuse 3.17 Darrick J. Wong
  2026-04-09 20:15 ` [GIT PULL 2/2] fuse4fs: fork a low level fuse server Darrick J. Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2026-04-09 20:13 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4, amir73il

Hi Ted,

As promised during this morning's ext4 call, this large patchbomb
contains the remaining improvements that I'd like to make to fuse2fs
before integrating iomap.

The first pull request drops libfuse2 support from e2fsprogs.

The second pull request creates a new fuse ext* server (fuse4fs) which
uses the lowlevel FUSE API instead of the high level one.  The major
advantage of using the lowlevel API is that all file operations are
performed in terms of inodes instead of paths.  As a result, fuse4fs has
MUCH less overhead than fuse2fs because we avoid the overhead of having
libfuse translate inode numbers to paths only to have fuse2fs translate
paths back into inode numbers.

Obviously, this stuff should go into e2fsprogs 1.48, not a 1.47.x stable
release.  This patchbomb hasn't changed much since its last posting on
12 Mar 2026.  The range-diff between then and now is appended below;
there aren't really any changes other than the effects of rebasing
against today's next branch and adapting to using autoheader(1).

One curious thing: I saw in [1] that you applied my get_thread_id
change, but it isn't in -next yet.  These PRs might not merge properly.
Obviously it's no big deal for me to rebase and send new PRs.

--D

 -:  -------------- >  1:  91f5b6651553fe fuse2fs: bump library version
 1:  7e7bb349a384f7 =  2:  cf80ae2e89ba2f fuse2fs: wrap the fuse_set_feature_flag helper for older libfuse
 2:  631d3f8d14b613 =  3:  c7d947ac718bb4 fuse2fs: disable nfs exports
 3:  96ca2a29cc7dcb !  4:  c137760397ef66 fuse2fs: drop fuse 2.x support code
    @@ configure.ac: then
      	AC_DEFINE_UNQUOTED(FUSE_USE_VERSION, $FUSE_USE_VERSION,
      		[Define to the version of FUSE to use])
      fi
     
      ## misc/fuse2fs.c ##
     @@
    - #endif /* __SET_FOB_FOR_FUSE */
      #include <inttypes.h>
      #include "ext2fs/ext2fs.h"
      #include "ext2fs/ext2_fs.h"
      #include "ext2fs/ext2fsP.h"
      #include "support/bthread.h"
    + #include "support/thread.h"
     -#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
     -# define FUSE_PLATFORM_OPTS	""
     -#else
     -# ifdef __linux__
     -#  define FUSE_PLATFORM_OPTS	",use_ino,big_writes"
     -# else
 4:  e048f198d7b598 =  5:  239f4b7ac05b69 fuse2fs: separate libfuse3 and fuse2fs detection in configure
 5:  3b02fa292dda7c !  6:  1536edf8a93539 fuse2fs: start porting fuse2fs to lowlevel libfuse API
    @@ fuse4fs/fuse4fs.c (new)
     +#endif /* __SET_FOB_FOR_FUSE */
     +#include <inttypes.h>
     +#include "ext2fs/ext2fs.h"
     +#include "ext2fs/ext2_fs.h"
     +#include "ext2fs/ext2fsP.h"
     +#include "support/bthread.h"
    ++#include "support/thread.h"
     +
     +#include "../version.h"
     +#include "uuid/uuid.h"
     +#include "e2p/e2p.h"
     +
     +#ifdef ENABLE_NLS
    @@ fuse4fs/fuse4fs.c (new)
     +	m = b % align;
     +	return b - m;
     +}
     +
     +#define dbg_printf(fuse4fs, format, ...) \
     +	while ((fuse4fs)->debug) { \
    -+		printf("FUSE4FS (%s): tid=%d " format, (fuse4fs)->shortdev, gettid(), ##__VA_ARGS__); \
    ++		printf("FUSE4FS (%s): tid=%llu " format, (fuse4fs)->shortdev, get_thread_id(), ##__VA_ARGS__); \
     +		fflush(stdout); \
     +		break; \
     +	}
     +
     +#define log_printf(fuse4fs, format, ...) \
     +	do { \
    @@ fuse4fs/fuse4fs.c (new)
     +		ret = -EUCLEAN;
     +		break;
     +	case EIO:
     +#ifdef EILSEQ
     +	case EILSEQ:
     +#endif
    ++#if EUCLEAN != EIO
     +	case EUCLEAN:
    ++#endif
     +		/* these errnos usually denote corruption or persistence fail */
     +		is_err = 1;
     +		ret = -err;
     +		break;
     +	default:
     +		if (err < 256) {
    @@ fuse4fs/fuse4fs.c (new)
     +
     +	return ret;
     +}
     
      ## lib/config.h.in ##
     @@
    - /* Define to 1 if you have the BSD-style 'qsort_r' function. */
    - #undef HAVE_BSD_QSORT_R
    + /* Define to 1 if fuse supports cache_readdir */
    + #undef HAVE_FUSE_CACHE_READDIR
      
    - /* Define to 1 if PR_SET_IO_FLUSHER is present */
    - #undef HAVE_PR_SET_IO_FLUSHER
    + /* Define to 1 if you have the <fuse.h> header file. */
    + #undef HAVE_FUSE_H
      
     +/* Define to 1 if fuse supports lowlevel API */
     +#undef HAVE_FUSE_LOWLEVEL
     +
    - /* Define to 1 if you have the Mac OS X function
    -    CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
    - #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
    + /* Define to 1 if you have the 'futimes' function. */
    + #undef HAVE_FUTIMES
    + 
    + /* Define to 1 if you have the 'getcwd' function. */
    + #undef HAVE_GETCWD
      
    - /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
    -    the CoreFoundation framework. */
 6:  480ffd57c3152f =  7:  de29e11fda2d6b debian: create new package for fuse4fs
 7:  eb97e1fefbf286 =  8:  d4aa426efc0f3c fuse4fs: namespace some helpers
 8:  7a2e6084f203a4 =  9:  a53dd84ef7ce0c fuse4fs: convert to low level API
 9:  8072dafea5ba54 = 10:  37dafcc0894b89 libsupport: port the kernel list.h to libsupport
10:  df5e76db0018b3 ! 11:  30b3c80ed6bcc5 libsupport: add a cache
    @@ lib/support/xbitops.h (new)
     +#define rounddown_pow_of_two(n) __rounddown_pow_of_two(n)
     +
     +#endif
     
      ## lib/support/Makefile.in ##
     @@ lib/support/Makefile.in: OBJS=		bthread.o \
    - 		profile_helpers.o \
      		prof_err.o \
      		quotaio.o \
      		quotaio_v2.o \
      		quotaio_tree.o \
    + 		thread.o \
      		dict.o \
     -		devname.o
     +		devname.o \
     +		cache.o
      
      SRCS=		$(srcdir)/argv_parse.c \
      		$(srcdir)/bthread.c \
      		$(srcdir)/cstring.c \
      		$(srcdir)/mkquota.c \
      		$(srcdir)/parse_qtype.c \
     @@ lib/support/Makefile.in: SRCS=		$(srcdir)/argv_parse.c \
    - 		$(srcdir)/profile_helpers.c \
      		prof_err.c \
      		$(srcdir)/quotaio.c \
      		$(srcdir)/quotaio_tree.c \
      		$(srcdir)/quotaio_v2.c \
    + 		$(srcdir)/thread.c \
      		$(srcdir)/dict.c \
     -		$(srcdir)/devname.c
     +		$(srcdir)/devname.c \
     +		$(srcdir)/cache.c
      
      LIBRARY= libsupport
      LIBDIR= support
      
      @MAKEFILE_LIBRARY@
      @MAKEFILE_PROFILE@
     @@ lib/support/Makefile.in: quotaio_v2.o: $(srcdir)/quotaio_v2.c $(top_builddir)/lib/config.h \
    -  $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/dqblk_v2.h \
    -  $(srcdir)/quotaio_tree.h
    + thread.o: $(srcdir)/thread.c $(top_builddir)/lib/config.h \
    +  $(top_builddir)/lib/dirpaths.h $(srcdir)/thread.h
      dict.o: $(srcdir)/dict.c $(top_builddir)/lib/config.h \
       $(top_builddir)/lib/dirpaths.h $(srcdir)/dict.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
11:  f13414a72be32f = 12:  fb17b6521f0430 cache: disable debugging
12:  383f3dd0b56f64 = 13:  b6d5640bdf0086 cache: use modern list iterator macros
13:  a9c0181ee15128 = 14:  0be92e2d351193 cache: embed struct cache in the owner
14:  31e5763e32dfc2 = 15:  a486e89007fb55 cache: pass cache pointer to callbacks
15:  a5c773947bd56d = 16:  ae4911b183fa9d cache: pass a private data pointer through cache_walk
16:  4f017b4dc8920f = 17:  9c5af5b9d39a70 cache: add a helper to grab a new refcount for a cache_node
17:  d1dea709493fdc = 18:  c6ed3f93d43660 cache: return results of a cache flush
18:  e59f4eba2f22f8 = 19:  a13c635ef81b43 cache: add a "get only if incore" flag to cache_node_get
19:  a999b4c74344cd = 20:  cbd9dbc6943267 cache: support gradual expansion
20:  019aa0d8a8c87d = 21:  5d91f82ff155b9 cache: support updating maxcount and flags
21:  0283835cbfa2db = 22:  7134be34c002f5 cache: support channging flags
22:  0f5c83c6c88c3f = 23:  2a8ddebbfa9298 cache: implement automatic shrinking
23:  26f78774c08acc ! 24:  dd17627e00495e fuse4fs: add cache to track open files
    @@ fuse4fs/fuse4fs.c
      #ifdef __SET_FOB_FOR_FUSE
      # error Do not set magic value __SET_FOB_FOR_FUSE!!!!
      #endif
      #ifndef _FILE_OFFSET_BITS
      /*
     @@
    - #endif /* __SET_FOB_FOR_FUSE */
      #include <inttypes.h>
      #include "ext2fs/ext2fs.h"
      #include "ext2fs/ext2_fs.h"
      #include "ext2fs/ext2fsP.h"
      #include "support/bthread.h"
    + #include "support/thread.h"
     +#include "support/list.h"
     +#include "support/cache.h"
      
      #include "../version.h"
      #include "uuid/uuid.h"
      #include "e2p/e2p.h"
24:  d6a2e3be991671 = 25:  2ea53b826253b6 fuse4fs: use the orphaned inode list
25:  2a4c9c2e579556 = 26:  6bd1919297a22f fuse4fs: implement FUSE_TMPFILE
26:  38cd25631692e6 = 27:  951a10258cada0 fuse4fs: create incore reverse orphan list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [GIT PULL 1/2] fuse2fs: upgrade to libfuse 3.17
  2026-04-09 20:13 [PULLBOMB v3 1.48] fuse4fs: drop libfuse2, add new server Darrick J. Wong
@ 2026-04-09 20:14 ` Darrick J. Wong
  2026-04-09 20:15 ` [GIT PULL 2/2] fuse4fs: fork a low level fuse server Darrick J. Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2026-04-09 20:14 UTC (permalink / raw)
  To: tytso; +Cc: amir73il, djwong, linux-ext4

Hi Ted,

Please pull this branch with changes for ext4.

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.

The following changes since commit 43643a57fb2d3368fbacd181a8cd713102d52a1a:

tests/f_opt_extent: use tune2fs from the build tree in the test script (2026-04-03 11:20:06 -0400)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/djwong/e2fsprogs.git tags/fuse2fs-library-upgrade_2026-04-09

for you to fetch changes up to c137760397ef6671832548bcd256778f57f49c2d:

fuse2fs: drop fuse 2.x support code (2026-04-09 13:00:40 -0700)

----------------------------------------------------------------
fuse2fs: upgrade to libfuse 3.17 [01/11]

In preparation to start hacking on fuse2fs and iomap, upgrade fuse2fs
library support to 3.17, which is the latest upstream release as of this
writing.  Drop support for libfuse2, which is now very obsolete.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>

----------------------------------------------------------------
Darrick J. Wong (5):
libsupport: change get_thread_id return type to unsigned long long
fuse2fs: bump library version
fuse2fs: wrap the fuse_set_feature_flag helper for older libfuse
fuse2fs: disable nfs exports
fuse2fs: drop fuse 2.x support code

lib/support/thread.h |   2 +-
configure            | 358 +++++----------------------------------------------
configure.ac         |  85 +++++-------
lib/support/thread.c |   4 +-
misc/fuse2fs.c       | 252 ++++++++----------------------------
5 files changed, 118 insertions(+), 583 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [GIT PULL 2/2] fuse4fs: fork a low level fuse server
  2026-04-09 20:13 [PULLBOMB v3 1.48] fuse4fs: drop libfuse2, add new server Darrick J. Wong
  2026-04-09 20:14 ` [GIT PULL 1/2] fuse2fs: upgrade to libfuse 3.17 Darrick J. Wong
@ 2026-04-09 20:15 ` Darrick J. Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2026-04-09 20:15 UTC (permalink / raw)
  To: tytso; +Cc: amir73il, djwong, linux-ext4

Hi Ted,

Please pull this branch with changes for ext4.

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.

The following changes since commit c137760397ef6671832548bcd256778f57f49c2d:

fuse2fs: drop fuse 2.x support code (2026-04-09 13:00:40 -0700)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/djwong/e2fsprogs.git tags/fuse4fs-fork_2026-04-09

for you to fetch changes up to 951a10258cada0508e185c58ebec74c47b0eb774:

fuse4fs: create incore reverse orphan list (2026-04-09 13:00:42 -0700)

----------------------------------------------------------------
fuse4fs: fork a low level fuse server [02/11]

Whilst developing the fuse2fs+iomap prototype, I discovered a
fundamental design limitation of the upper-level libfuse API: hardlinks.
The upper level fuse library really wants to communicate with the fuse
server with file paths, instead of using inode numbers.  This works
great for filesystems that don't have inodes, create files dynamically
at runtime, or lack stable inode numbers.

Unfortunately, the libfuse path abstraction assigns a unique nodeid to
every child file in the entire filesystem, without regard to hard links.
In other words, a hardlinked regular file may have one ondisk inode
number but multiple kernel inodes.  For classic fuse2fs this isn't a
problem because all file access goes through the fuse server and the big
library lock protects us from corruption.

For fuse2fs + iomap this is a disaster because we rely on the kernel to
coordinate access to inodes.  For hardlinked files, we *require* that
there only be one in-kernel inode for each ondisk inode.

The path based mechanism is also very inefficient for fuse2fs.  Every
time a file is accessed, the upper level libfuse passes a new nodeid to
the kernel, and on every file access the kernel passes that same nodeid
back to libfuse.  libfuse then walks its internal directory entry cache
to construct a path string for that nodeid and hands it to fuse2fs.
fuse2fs then walks the ondisk directory structure to find the ext2 inode
number.  Every time.

Create a new fuse4fs server from fuse2fs that uses the lowlevel fuse
API.  This affords us direct control over nodeids and eliminates the
path wrangling.  Hardlinks can be supported when iomap is turned on,
and metadata-heavy workloads run twice as fast.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>

----------------------------------------------------------------
Darrick J. Wong (23):
fuse2fs: separate libfuse3 and fuse2fs detection in configure
fuse2fs: start porting fuse2fs to lowlevel libfuse API
debian: create new package for fuse4fs
fuse4fs: namespace some helpers
fuse4fs: convert to low level API
libsupport: port the kernel list.h to libsupport
libsupport: add a cache
cache: disable debugging
cache: use modern list iterator macros
cache: embed struct cache in the owner
cache: pass cache pointer to callbacks
cache: pass a private data pointer through cache_walk
cache: add a helper to grab a new refcount for a cache_node
cache: return results of a cache flush
cache: add a "get only if incore" flag to cache_node_get
cache: support gradual expansion
cache: support updating maxcount and flags
cache: support channging flags
cache: implement automatic shrinking
fuse4fs: add cache to track open files
fuse4fs: use the orphaned inode list
fuse4fs: implement FUSE_TMPFILE
fuse4fs: create incore reverse orphan list

lib/ext2fs/jfs_compat.h  |    2 +-
lib/ext2fs/kernel-list.h |  111 -
lib/support/cache.h      |  184 ++
lib/support/list.h       |  901 +++++++
lib/support/xbitops.h    |  128 +
Makefile.in              |    3 +-
configure                |  441 ++--
configure.ac             |  156 +-
debian/control           |   12 +-
debian/fuse4fs.install   |    2 +
debian/fuse4fs.links     |    3 +
debian/rules             |   11 +
debugfs/Makefile.in      |   12 +-
e2fsck/Makefile.in       |   56 +-
fuse4fs/Makefile.in      |  193 ++
fuse4fs/fuse4fs.1.in     |  118 +
fuse4fs/fuse4fs.c        | 6451 ++++++++++++++++++++++++++++++++++++++++++++++
lib/config.h.in          |    3 +
lib/e2p/Makefile.in      |    4 +-
lib/ext2fs/Makefile.in   |   14 +-
lib/support/Makefile.in  |    8 +-
lib/support/cache.c      |  882 +++++++
misc/Makefile.in         |   18 +-
misc/tune2fs.c           |    4 -
24 files changed, 9248 insertions(+), 469 deletions(-)
delete mode 100644 lib/ext2fs/kernel-list.h
create mode 100644 lib/support/cache.h
create mode 100644 lib/support/list.h
create mode 100644 lib/support/xbitops.h
create mode 100644 debian/fuse4fs.install
create mode 100644 debian/fuse4fs.links
create mode 100644 fuse4fs/Makefile.in
create mode 100644 fuse4fs/fuse4fs.1.in
create mode 100644 fuse4fs/fuse4fs.c
create mode 100644 lib/support/cache.c


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-09 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 20:13 [PULLBOMB v3 1.48] fuse4fs: drop libfuse2, add new server Darrick J. Wong
2026-04-09 20:14 ` [GIT PULL 1/2] fuse2fs: upgrade to libfuse 3.17 Darrick J. Wong
2026-04-09 20:15 ` [GIT PULL 2/2] fuse4fs: fork a low level fuse server Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox