Commit graph

24 commits

Author SHA1 Message Date
Antonio SJ Musumeci
b885f1ee39 fix: relocate from the fd's current branch on repeated ENOSPC
- moveonenospc copied from the branch stored when the file was opened,
  which a move never updates, so a second ENOSPC on the same handle
  tried to copy a path that no longer existed and failed with ENOSPC.
- Find the source branch from the fd at the start of each move, as
  before e216a81a. findonfs now matches inode as well as device, so
  branches on one filesystem are told apart, and tries the stored
  branch first. No match leaves the write's ENOSPC in place.
- Drop destinations that are the source directory, matched by device
  and inode so another path to it counts. The copy was renamed over
  the file and then unlinked, deleting it while the write reported
  success. A first move could already pick the source (EDQUOT with
  free space); finding the real source let later moves do it too.
  With no destination left the write keeps its error.
- TEST_movefile_enospc adds a handle that has to move twice.
  tests.cpp covers a move onto the source branch by its own path
  and by an alias.
2026-11-21 01:09:37 -05:00
Antonio SJ Musumeci
6d138906ec Fix ARMv5 atomic loads from Boost dummy storage 2026-11-14 18:27:14 -06:00
Antonio SJ Musumeci
74eade91f5 Preserve directory modes when cloning paths across branches
- Restore source permissions after ownership to preserve setgid and clear unwanted inherited mode bits.
- Add regression coverage for directory modes, group inheritance, and existing destination directories.
- Update the branch configuration test to use the current API.
- Document metadata preservation when cloning directory paths.
2026-11-04 19:25:10 -06:00
Antonio SJ Musumeci
b10fb10590 fix: preserve source ownership in EXDEV symlink fallbacks 2026-11-01 21:11:04 -06:00
Antonio SJ Musumeci
7b7e96bbc5 fix: initialize EXDEV rename staging for root sources 2026-11-01 21:11:04 -06:00
Antonio SJ Musumeci
3d81e24f32 fix: keep EXDEV rename symlink targets relative 2026-11-01 21:11:04 -06:00
Antonio SJ Musumeci
28d809f2f8 Fix MSP create policy hangs when no branches qualify
- Stop parent traversal after evaluating the empty relative root.
- Preserve filtering errors, parent fallback, and closest-path selection.
- Cover all four MSP policies with rejection and fallback regressions.
- Document errors when traversal exhausts the branch root.
2026-11-01 21:11:04 -06:00
Antonio SJ Musumeci
f1034a3ad6 Remove timed node removal 2026-05-06 20:49:46 -04:00
Antonio SJ Musumeci
943f91ff98 Strengthen mergerfs integration tests
- Make the test runner fail on failed tests and report explicit skips
- Strengthen assertions for O_DIRECT, LUP policy, EXDEV fallback, and xattrs
- Fix cleanup and file descriptor handling across test scripts
2026-04-29 20:25:20 -04:00
Antonio SJ Musumeci
ef1e01b5a5 Add unit and integration tests for recently changed code
Unit tests (29 new in tests/tests.cpp):
- str::eq() and str::startswith() char* nullptr safety
- str::from() u64/s64/int suffix parsing (K/M/G/T, overflow, invalid)
- num::humanize() byte formatting (0, 512, 1K, 1M, 1G, 1T, non-exact)
- RmdirErr priority error accumulation (ENOTEMPTY/EEXIST override rules)
- HashSet inline-to-heap growth, empty string, and large insertion
- fs::inode algorithm switching (valid/invalid names, passthrough raw ino,
  distinct inodes across algorithms)
- RND::rand64() bounds (range, max, shrink_to_rand_elem)
- Branches::Impl copy and move assignment re-links default_minfreespace

Integration tests (5 new in tests/):
- TEST_policy_lup: LUP policy create and search
- TEST_rmdir_enotempty_priority: rmdir returns ENOTEMPTY for non-empty dirs
- TEST_open_after_unlink: read/write via fd after unlink
- TEST_api_xattr: mergerfs xattr API (fullpath, relpath, basepath, allpaths)
- TEST_movefile_enospc: moveonenospc configuration round-trip

Also: remove xattr nosys checks from TEST_cfg_xattr_modes, reformat
integration test scripts to use temp_dir/cleanup_dir helpers, and
minor parameter alignment changes in fuse_getxattr, fuse_init,
fuse_rename.
2026-04-29 17:41:00 -04:00
Antonio S. Musumeci
351adc2b20 Add tests for HashSet, rapidhash withSeed consistency, and ReaddirCalc parity with calc
Some checks failed
mkdocs / deploy (push) Has been cancelled
2026-04-12 23:44:23 -05:00
Antonio SJ Musumeci
0f1a8e9b69 Fix error condition in fs_copyfile 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
076e359891 Improve thread pool 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
8f1ef59770 Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
Antonio SJ Musumeci
160d3c832d Fix branches unit test 2026-03-02 01:09:16 -05:00
trapexit
cfaad60275
Misc updates to arg parsing (#1554)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled
Ignore "defaults" and add a number of more modern VFS mount switches
2025-10-26 21:05:05 -05:00
trapexit
d7549f8d53
Fix string manipulation functions after refactor (#1514) 2025-08-22 19:42:31 -05:00
Ilya Taranov
d04e04e89a Fix config file parsing 2023-03-10 20:55:20 -08:00
Antonio SJ Musumeci
d337574665 fix parsing of relative branch paths 2021-02-11 19:22:17 -05:00
Antonio SJ Musumeci
538467b86d config: rework global config, remove rwlock, make branches RCU like
Also added unit tests. Should have done separately but found a number of bugs.
2021-01-14 21:02:10 -05:00