Commit graph

56 commits

Author SHA1 Message Date
Antonio S. Musumeci
6d9b997e5d docs: correct read-thread-count in the options list
- read-thread-count=0 was documented as the number of logical cores.
  It is capped at 8, or becomes 2 read threads when process-thread-count
  is enabled too, as threads.md says.
- Drop the sentence that read-thread-count=-1 with process-thread-count
  picks reasonable values. -1 follows the negative rule like any other
  negative count: the core count divided by 1, up to the 64 limit. Only
  0 is resolved specially.
- Point at threads.md for how the two settings combine.
2026-11-22 08:38:40 -05:00
Antonio S. Musumeci
898ad5992d fix: keep failed statvfs results in the cache and track entry validity
- A new entry was told apart from a fresh one only by its time of 0.
  With a timeout at least the current time in seconds, such as
  cache.statfs=4294967295, a new entry looked fresh before statvfs
  had run, so the zeroed struct was returned as success: every branch
  reported no free space and every create failed with ENOSPC, and a
  nonexistent path succeeded. 3735d721 applies cache.statfs from the
  mount options, which made it reachable from fstab. Give the entry a
  valid flag set by the first statvfs.
- 5e74822f stopped caching a failure as a success by retrying it on
  every call, under the exclusive lock. With a branch that fails
  slowly, such as an unreachable network mount, each caller then
  waited for its own failure one after the other: eight callers took
  2.4s where 2.42.2 took 0.3s. Keep the failure, as an error, for the
  timeout like a success. It is still never returned as zeroed space.
- Read the clock again once the lock is held, so a caller that waited
  doesn't compute a negative age against the entry another refreshed.
- Tests: a failure is kept until the timeout, and timeouts of
  4294967295 and UINT64_MAX still return real values and errors. Both
  fail without this change.

Measure age with a steady clock, starting when statvfs returns. Even a
refresh slower than the configured timeout can be shared by callers
that waited for it; wall-clock adjustments cannot extend its lifetime.
2026-11-22 08:28:48 -05:00
Antonio S. Musumeci
64d3af02a3 fix: return the error, not a short count, for page cache flushes
- 072b07b6 made a write that fails with ENOSPC after part of it landed
  return the bytes written. The kernel issues writes to flush its page
  cache (cache.writeback, dirty mmap pages) with the writepage flag
  and ignores the size in the reply, then drops the pages. The short
  count lost the rest of the data and hid the error: write, fsync,
  msync and close all succeeded with half the data on disk, where
  2.42.2 returned ENOSPC from fsync or msync.
- Keep the short count for ordinary writes, which the kernel does
  handle, and return the error when the request has writepage set.
- TEST_movefile_enospc covers a writeback flush and an mmap msync with
  moveonenospc=false; both fail without this change. Note the
  exception in moveonenospc.md.

Initialize the flush-test error list before the first I/O operation so
an unexpected error propagates and the descriptor is still closed.
Use the mapping as a context manager for the same reason.
2026-11-22 08:27:04 -05:00
Antonio S. Musumeci
bc7b7ffeae fix: report a short write when ENOSPC recovery fails after a prefix
- 78a67fd0 kept the bytes written before ENOSPC when the move worked.
  When it didn't (moveonenospc off, no branch to move to, the move or
  the retry failing, or a non-ENOSPC error), write still returned the
  error and dropped the count, though those bytes were on disk. An
  O_APPEND writer that retried the whole buffer duplicated them.
- Return the bytes written as a short write whenever some reached the
  file, as a local filesystem does. A write that wrote nothing still
  returns the error.
- TEST_movefile_enospc checks it with moveonenospc=false and a write
  bigger than the space left. Document it in moveonenospc.md.
2026-11-22 01:27:22 -05:00
Antonio S. Musumeci
48f26f3731 docs: correct func.readdir counts and the queue depth of 0
- func.readdir's cor and cosr rows said a negative thread count is the
  core count divided by it. The parser only accepts digits, so a
  negative count is rejected as invalid. Say what 0 does instead: the
  core count, at most 8 threads, and a queue depth of 2 per thread.
- process-thread-queue-depth said 0 makes the depth the process thread
  count. It sets the per-thread depth to 2, as threads.md says.
2026-11-22 01:25:13 -05:00
Antonio S. Musumeci
cd0679b01f fix: leave the source branch out before moveonenospc picks a branch
- The source branch was dropped from the create policy's result. ff,
  mfs, lfs, lus and pfrd return a single branch, so when that branch
  was the source nothing was left and the write kept ENOSPC even with
  room elsewhere. That happens when the source has free space by
  statvfs but still returns ENOSPC or EDQUOT: a quota, exhausted
  inodes, full btrfs metadata, or a cached statfs.
- Build the candidate list without the source (matched by device and
  inode, as before) and run the policy on that, so it picks another
  branch. With no candidate left the move is still refused.
- test_fs_movefile_and_open_same_branch now checks that ff relocates
  past a source listed first, by its own path or an alias, and that a
  list made only of the source is refused.

Refuse relocation if a duplicate on another branch could become visible
when the source is removed. Keep non-replacing publication to protect
against a late arrival at the destination. The mounted test checks the
original and duplicate contents, then reopens the file through the pool.
2026-11-22 01:24:45 -05:00
Antonio SJ Musumeci
db9e991ebd fix: saturate the process thread queue depth instead of overflowing
- process-thread-queue-depth is multiplied by the process thread
  count. A large depth overflowed the int, e.g.
  process-thread-queue-depth=1073741824 with 2 process threads, which
  is undefined behaviour.
- Cap the product at INT_MAX. The queue only counts free slots, so a
  depth that large is unbounded in practice, as asked for.
2026-11-21 18:12:38 -05:00
Antonio SJ Musumeci
127c2e6238 fix: cap thread pools at 64 and warn when clamped
- Limit read-thread-count, process-thread-count and the cor/cosr pool
  size in func.readdir to 64 threads per pool. Apply the cap after
  resolving automatic and CPU-divided counts; keep disabled process
  pools disabled and preserve the configured strings.
- Log a syslog warning identifying the setting and limit when clamped.
  For readdir, warn only when applying a valid concurrent policy,
  not during validation.
- Document the fixed cap and warning behavior. Queue depths retain
  their separate limits and use the clamped thread count.
- Resolve negative FUSE counts without overflowing on INT_MIN.

Document that both readdir inputs must fit in int and that a queue
depth whose product with the resolved thread count exceeds INT_MAX
is rejected, not clamped.
2026-11-21 17:48:28 -05:00
Antonio SJ Musumeci
e5a4f72c4d fix: restore the mode when an nfsopenhack open fails
- nfsopenhack adds S_IWUSR|S_IWGRP to a read-only file so the open
  can succeed, and resets the mode on the new fd. When the open still
  failed, the write bits stayed on the file.
- Pin the inode before changing its permissions. Use that reference for
  the temporary mode, retry and restoration, so a concurrent rename
  cannot apply the original mode to an unrelated replacement.
2026-11-21 14:53:55 -05:00
Antonio SJ Musumeci
ecb4de5bc0 Fix branch snapshot lifetime in EXDEV link fallback 2026-11-06 12:10:05 -06:00
Antonio SJ Musumeci
78a67fd066 fix: preserve partial append progress during ENOSPC recovery 2026-11-06 11:24:49 -06:00
Antonio SJ Musumeci
2513d3c067 Cap getdents64 requests at 128 KiB for virtiofs compatibility 2026-11-05 16:05:51 -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
cfb925e5ae docs: clarify branch resolution and mount ordering 2026-09-21 13:46:38 -05:00
Antonio SJ Musumeci
99835a0178 Document advisory locking limitation and update deprecated options
- Add documentation explaining that advisory file locking is not supported

- Add remember-nodes to deprecated options mapping

- Add comment explaining stat_crc32b fingerprint invalidation behavior

- Fix heading level for Host vs Container identity section
2026-05-06 20:49:46 -04:00
Antonio SJ Musumeci
f1034a3ad6 Remove timed node removal 2026-05-06 20:49:46 -04:00
Antonio SJ Musumeci
9fb1642e93 Fix docs regarding "noforget" 2026-04-20 23:25:47 -05:00
trapexit
b4239495a0
Update docs for logging changes + new video (#1618)
Some checks failed
mkdocs / deploy (push) Has been cancelled
2026-02-12 23:21:43 -06:00
François-Xavier Payet
22df87c86a
Add LUP policy (#1601)
Some checks are pending
mkdocs / deploy (push) Waiting to run
2025-12-14 00:36:12 -06:00
trapexit
9b046d9a34
Rework credential handling to support chroot & idmap (#1595)
Some checks are pending
mkdocs / deploy (push) Waiting to run
Run in an elevated credential mode (root) and let the kernel manage
entitlements. Will result in slightly different behavior but should
not be noticed by most.
2025-12-05 21:03:48 -06:00
trapexit
3bacaa6f7f
Add lazy-umount-mountpoint page and mount -a FAQ (#1573) 2025-11-12 12:19:00 -06:00
trapexit
077484323c
Fix variable names of fuse-msg-size and posix-acl (#1553)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled
2025-10-25 17:00:16 -05:00
trapexit
700fcfccf5
Update fuse-msg-size docs (#1552)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-10-24 23:34:28 -05:00
trapexit
4b4801add6
Config options docs updates (#1551) 2025-10-24 22:31:04 -05:00
trapexit
727c522fb8
Rework config, centralize fuse config (#1547)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-10-24 08:20:29 -05:00
trapexit
569a151da2
Add ability to proxy ioprio of client apps (#1534)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled
2025-09-26 11:36:56 -05:00
trapexit
1707dc27e3
Misc doc updates (#1531)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-09-21 14:25:24 -05:00
pjv
6acef3a638
Fix typo in moveonenospc.md (#1527)
typo
2025-09-21 11:42:15 -05:00
trapexit
b3656a0243
Fix broken doc links (#1525)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled
2025-09-19 19:25:31 -05:00
trapexit
41b40b94fa
Misc docs updates (#1524) 2025-09-19 19:20:28 -05:00
trapexit
ca59ae53a5
idmap mount support (#1523)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled
* Add idmap mount support

* Further replacement of std::filesystem::path to fs::path

* Update docs regarding idmap support
2025-09-18 00:07:28 -05:00
trapexit
5becb334cd
Misc updates of docs (#1518)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled
2025-09-01 20:58:58 -05:00
trapexit
2101ef5bcc
Updates to docs, add nonraid, more intro to fs details (#1512)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-08-21 15:09:04 -05:00
trapexit
f852474073
Update the secondary group cache (#1492)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
* Use concurrent_flat_map to build a global cache rather than per
thread.
* Create global maintanence thread manager for clearing unused cache
entries.
2025-07-05 17:05:53 -05:00
trapexit
095fcf82a3
Misc doc updates
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-06-08 23:59:17 -05:00
trapexit
1b167d34d8
Spawn "mount" on branches when waiting for mounts enabled
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-06-08 15:09:47 -05:00
trapexit
e310d24615
Add support for FUSE passthrough
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run
2025-06-05 23:47:42 -05:00
trapexit
923d9608e8
Add details to docs about FreeBSD limitations 2025-05-09 21:18:20 -05:00
trapexit
344014aa81
Rework thread pool for increased stability + config and doc updates (#1453)
Also updates fmt to 11.2.0 and replaced syslog usage with a wrapper
leveraging fmt.
2025-05-05 18:28:49 -05:00
Antonio SJ Musumeci
2b04a791b7 Add config option to control default_permissions
Defaults true but there might be some situations where it is useful to
disable.
2025-04-25 16:34:39 -05:00
Antonio SJ Musumeci
de2a82800a Improve mount waiting + misc doc improvements
Adds user.mergerfs.branch and user.mergerfs.branch_mounts_here
Adds .mergerfs.branch and .mergerfs.branch_mounts_here files.
2025-04-23 15:58:36 -05:00
Antonio SJ Musumeci
9dac54f223 Misc doc updates + add logo 2025-04-19 22:44:08 -05:00
Antonio SJ Musumeci
c769e959e8 Add doc pages for minfreespace and moveonenospc + other misc updates 2025-04-10 22:59:49 -05:00
Antonio SJ Musumeci
95732222d9 Update docs regarding error handling 2025-04-04 18:41:58 -05:00
Antonio SJ Musumeci
b7f7f7fa97 Change misc defaults
* category.create=pfrd
* moveonenospc=pfrd
* cache.files=off
* parallel-direct-writes=true

These changes were made to match the recommended settings for most
users to reduce confusion.
2025-03-30 17:22:38 -05:00
Antonio SJ Musumeci
92ae63e842 Support Linux v6.13 FUSE max_page_limit 2025-03-30 00:07:08 -05:00