Antonio S. Musumeci
c0b4ea3fae
Fix destructor race with _remove_self during shutdown
...
The destructor and autoscale idle-exit path could race: a worker
calling _remove_self would erase itself from _threads and detach
while the destructor was iterating _threads to enqueue poison pills
and join. This could cause too few poison pills (deadlocking
remaining workers) or pthread_join on a detached thread (UB).
Two changes:
- _remove_self now checks _stop and returns immediately during
shutdown, ensuring no thread detaches after destruction begins.
- Destructor snapshots _threads under the mutex before enqueueing
poison pills and joining, so it operates on a stable copy.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 19:35:35 -04:00
Antonio S. Musumeci
9ae145b7e9
checkpoint
2026-04-09 19:31:47 -04:00
Antonio S. Musumeci
9dc461c96d
checkpoint
2026-04-09 19:13:58 -04:00
Antonio SJ Musumeci
3905355522
Detect OS for release-sample make target
mkdocs / deploy (push) Has been cancelled
2026-04-08 20:48:02 -05:00
Antonio SJ Musumeci
9e2e1afafa
Update docs on limiting drive spinup
mkdocs / deploy (push) Has been cancelled
2026-04-06 14:01:20 -05:00
Antonio SJ Musumeci
6d218fa87f
Misc updates and fixes
mkdocs / deploy (push) Has been cancelled
2026-04-04 02:46:24 -05:00
Antonio SJ Musumeci
3b10406f95
Add more details to project comparisons
2026-04-04 02:17:06 -05:00
Antonio SJ Musumeci
f2c8e5d9eb
Add FUSE request_timeout
...
mkdocs / deploy (push) Has been cancelled
Not yet hooked up to config parser to set as need to evaluate usage.
2026-04-01 23:20:05 -05:00
Antonio SJ Musumeci
b581c5d5e7
Add support for FUSE_COPY_FILE_RANGE_64
2026-04-01 23:20:05 -05:00
Antonio SJ Musumeci
1ebc8cfa5f
Enable statx with file handle
mkdocs / deploy (push) Waiting to run
2026-03-31 19:53:17 -04:00
Antonio SJ Musumeci
acfa797503
Misc formatting changes
2026-03-31 19:53:17 -04:00
Antonio SJ Musumeci
7fc20457ca
Rework open file resource management
2026-03-31 19:53:17 -04:00
Antonio SJ Musumeci
ecee84b323
Improve proj comparisons + new SnapRAID details
2026-03-31 19:51:28 -04:00
Antonio SJ Musumeci
b8776d205d
Update docs; add nofs, policyfs and greyhole
mkdocs / deploy (push) Has been cancelled
2026-03-27 22:54:39 -05:00
Antonio SJ Musumeci
06433a0548
Fallback to fusermount3 where available
...
mkdocs / deploy (push) Has been cancelled
Also general cleanup of mount_generic.
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
f4b602340b
Add more integration tests
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
a78aef36e0
Additional check for ENOTCONN on mount
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
0d05523dfd
Move maintainence thread func take u64 rather than int
...
signed rollover is UB
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
0cfab60f37
replace raw C-strings with std::string in converted libfuse files
...
util/mount.mergerfs.cpp:
- Remove xstrdup/xrealloc wrappers entirely
- Convert type, source, options, command, setuid to std::string
- Replace add_arg() pointer-rewriting with shell_quote() returning std::string
- Replace add_option() with simple std::string += concatenation
- Fix const_cast UB on string literal assignment
lib/helper.cpp:
- Convert add_default_subtype local subtype_opt: malloc+snprintf+free -> std::string construction
lib/mount_generic.h:
- Convert fuse_mount_sys locals source/type: malloc+strcpy+strcat -> std::string
- Remove 4 unnecessary free() calls (RAII cleanup)
- .c_str() at mount() and fuse_mnt_add_mount() boundaries
lib/mount_util.h:
- Rewrite fuse_mnt_resolve_path internals using std::string: rfind/substr
instead of manual pointer arithmetic, strrchr, strlen chains
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
21966ade97
Convert vendored/libfuse C sources to C++17
...
Convert all C source files in vendored/libfuse/ to C++17:
- lib/crc32b.c -> crc32b.cpp (const void* cast)
- lib/fuse_opt.c -> fuse_opt.cpp (designated init, void* arithmetic)
- lib/fuse_signals.c -> fuse_signals.cpp
- lib/helper.c -> helper.cpp (void* data cast)
- lib/mount.c -> mount.cpp (thin wrapper)
- lib/mount_generic.c -> mount_generic.h (static inline, #pragma once)
- lib/mount_bsd.c -> mount_bsd.h (static inline, #pragma once)
- lib/mount_util.c -> mount_util.h (static inline, #pragma once)
- util/fusermount.c -> fusermount.cpp
- util/mount.mergerfs.c -> mount.mergerfs.cpp
Key changes:
- Replace C99 designated initializer in fuse_opt_parse with field-by-field init
- Fix void* pointer arithmetic via char* base + offset pattern
- All C-style (T*)voidptr casts replaced with static_cast/reinterpret_cast
- Remove redundant #define _GNU_SOURCE (already in FUSE_FLAGS)
- Wrap __clone2 declaration in extern "C" for ia64 path
- Update Makefile: empty SRC_C, build utils with $(CXX) instead of $(CC)
- Remove stale .c files now replaced by .cpp/.h counterparts
All binaries build cleanly: mergerfs, mergerfs-fusermount, mount.mergerfs
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
96eb51eecb
Move fuse_session to C++ and make exit flag atomic
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
881147daa2
Fix null ptr handling issue in ioctl processing
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
0f1a8e9b69
Fix error condition in fs_copyfile
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
08f9cc6932
Fix readlink implementation, add more tests
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
3099b15db1
More aggressive error handing with pagesize queries
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
07b1e6bdba
Auto-commit fuse_msgbuf.cpp
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
7763c7384a
Use fatal::abort() rather than assert in places
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
61365d226d
Move scope_guard to vendored/
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
f33e78bc24
Cleanup procfs and abort on critical issues
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
7f52623536
Cleanup branches and add more unit tests
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
a30a4df9c0
Cleanup config and add tests
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
1e0d5aa91d
fs_wait_for_mount cleanup
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
d09fadbc28
fs_inode cleanup
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
21ce889449
Fixup listxattr error handling
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
9d1a4696e9
Small improvements to fs::statvfs_cache
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
ed0cbcf064
Cleanup fuse_readlink
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
076e359891
Improve thread pool
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
bf98d3f3a6
Fix possible error handling issue with errno
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
c45c5ce920
Make cfgfile depth calculation thread friendly
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
e0a892f0d0
Improve error handling when querying pagesize
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
164b7f73c9
Misc fixes and improvements to thread pool
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
3a45be4cd8
Rework string utils, more test cases
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
107a3acf95
Better error handling in pagesize config type
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
a5eafb8972
Check string is not empty before resize in Config::keys
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
8199cc8a8b
Fix error handling in fuse chmod, chown, setxattr, removexattr
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
e5d897f3dc
Ensure zero initialized timeouts structs
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
c0af09f7d8
Fix incorrect type in fs_read and write
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
1b1e14ca29
Remove dead branch in fuse_reply_data
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
82b89aa099
Change session->exited to sig_atomic_t
2026-03-24 21:13:34 -04:00
Antonio SJ Musumeci
aa91e1b2ba
Initialize stat buffer and add stat call in fuse_mount_sys
2026-03-24 21:13:34 -04:00