mergerfs/vendored/libfuse/lib
Antonio SJ Musumeci eea1c1bc09 fix: keep readdir listings stable under fill errors
- func.readdir=cor appended entries in whichever order branch workers
  finished. Directory offsets are positions in that list, so a reader
  reopening an unchanged directory and seeking to a previously issued
  cookie (NFS does this) could see a duplicate and miss a later entry.
  Read branches concurrently into their own buffers, then merge and
  deduplicate them in configured branch order. The merge mutex is gone.
- Growing a dirents buffer overwrote the only pointer with realloc's
  result while recording the new capacity, so an allocation failure
  leaked the buffer and the next fill wrote through NULL. Grow both
  vectors without changing pointer, length or capacity until the
  allocation succeeds, and return ENOMEM.
- seq and cosr ignored that failure and served a listing with entries
  missing. Every policy now returns the error, and libfuse resets the
  handle's buffer whenever a fill fails, so a later request at a
  nonzero offset re-enumerates instead of serving a partial or stale
  listing as success. cosr closes the directories its workers opened
  when it gives up early.
- Document the fill-error contract, which doesn't promise that every
  branch was read: seq and cosr can treat a branch read error as the
  end of the directory. Document cor's memory use, and refer to
  func.getattr, not fuse.getattr.
- TEST_readdir_cor_cookie_replay compares cor listings, offsets and
  inodes with seq and replays cookies on fresh handles.
  TEST_dirents_allocation injects allocation failures into the dirents
  code. TEST_readdir_cor_enomem fails one allocation in a mounted
  daemon for cor and seq and checks the same handle then serves the
  exact suffix.

Performance: cor copies each entry twice and merges serially after the
parallel reads. Listing 100,000 entries over 4 tmpfs branches took
the same time before and after (81-83 ms per listing for cor:4 and
seq). Peak daemon memory for cor:4 dropped from 27.4 MB to 18.7 MB.
2026-11-29 23:11:07 -05:00
..
cpu.cpp libfuse: small safety and portability fixes across opt/cpu/fusermount/maintenance_thread 2026-04-18 13:47:23 -05:00
cpu.hpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
crc32b.cpp Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
crc32b.h Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
debug.cpp Require C++20-capable build toolchains 2026-05-13 13:55:43 -05:00
format.cpp Move fmtlib to vendored and upgrade to 12.1.0 2026-03-02 01:09:16 -05:00
fuse.cpp fix: keep readdir listings stable under fill errors 2026-11-29 23:11:07 -05:00
fuse_cfg.cpp Use shared_mutex for fuse log config 2026-05-14 00:22:06 -04:00
fuse_dirents.cpp fix: keep readdir listings stable under fill errors 2026-11-29 23:11:07 -05:00
fuse_i.hpp Manage cloned /dev/fuse fds in sessions 2026-05-14 20:13:07 -05:00
fuse_loop.cpp fix: free a read thread's buffer when it is cancelled at shutdown 2026-11-29 23:11:04 -05:00
fuse_lowlevel.cpp Manage cloned /dev/fuse fds in sessions 2026-05-14 20:13:07 -05:00
fuse_msgbuf.cpp More aggressive error handing with pagesize queries 2026-03-24 21:13:34 -04:00
fuse_opt.cpp libfuse: small safety and portability fixes across opt/cpu/fusermount/maintenance_thread 2026-04-18 13:47:23 -05:00
fuse_req.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
fuse_session.cpp Manage cloned /dev/fuse fds in sessions 2026-05-14 20:13:07 -05:00
fuse_signals.cpp libfuse: use atomic fuse_session pointer in signal handler 2026-04-18 13:47:23 -05:00
helper.cpp Use unmount() on FreeBSD for ENOTCONN umount 2026-05-07 17:49:24 -04:00
maintenance_thread.cpp libfuse: small safety and portability fixes across opt/cpu/fusermount/maintenance_thread 2026-04-18 13:47:23 -05:00
mount.cpp Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
mount.hpp Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
mount_bsd.h Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
mount_generic.h Fallback to fusermount3 where available 2026-03-24 21:13:34 -04:00
mount_util.h replace raw C-strings with std::string in converted libfuse files 2026-03-24 21:13:34 -04:00
node.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
node.hpp Remove timed node removal 2026-05-06 20:49:46 -04:00
pin_threads.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
pin_threads.hpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
xalloc.hpp libfuse: harden fuse.cpp against NULL nodes; use lock guards; check allocations 2026-04-18 13:47:23 -05:00