mergerfs/mkdocs/docs/config
Antonio SJ Musumeci c9854f236f fix: make the rename-exdev fallback safe and transactional
rename-exdev (opt-in; the default is passthrough) moves a source it
cannot rename across branches into a staging tree and publishes a
symlink at the destination. This reworks that fallback so a rename
either completes or leaves both names as they were.

- Staging opens every component relative to a pinned parent with
  O_NOFOLLOW, requires a daemon-owned staging root, and refuses when
  the tree can't be trusted.
- Staged names are taken without replacement and must be free on
  every configured branch, not only those holding the source, so a
  later lookup cannot reach another rename's payload. Over-long names
  are shortened. Fallback renames are serialized.
- Destinations: a compatible existing destination is replaced, kept
  under a temporary name until every branch is published, and
  restored if a later branch fails. A destination on a read-only
  branch, or a no-create one where the link can't be created, is
  refused before anything moves. Temporary and restore names never
  replace an entry, and a restore that fails is reported.
- An ordinary rename (rename-exdev=passthrough) also refuses with
  EXDEV when the destination exists on a read-only branch that does
  not hold the source: that copy could neither be replaced nor
  removed and would shadow the renamed file there. It is never
  scheduled for removal either.
- The replacement symlink is prepared in a daemon-private directory,
  its UID and GID are verified through a pinned descriptor, and it is
  published without replacement, before any source moves. A sticky,
  world-writable destination directory under Linux protected symlinks
  is refused. Each prepared link is tracked by identity for cleanup.
- Symlink sources are recreated with their original text, owner and
  times instead of staged, since staging changes where a relative
  target resolves. Sources of different types on different branches
  are refused. A hidden source that cannot be removed fails the rename.
- libfuse re-parents the kernel's node onto the staged inode, using a
  name allocated before publication, so open handles and cached
  dentries keep working and nothing can fail after the rename commits.
- Without renameat2 (FreeBSD 14.4 and 15.0, or seccomp), regular
  files and directories use a portable layout: a fresh daemon-owned
  wrapper, access gates that mirror the source's parents with the
  source's GID and its read and execute bits only, and the payload
  directory inside the last gate. Foreign-owned parents, unsettable
  group ownership and non-trivial ACLs are refused before the source
  moves. A namespace the source never entered is removed. A portable
  directory that can't be restored stays staged with its path logged,
  and an existing directory destination is refused before a portable
  source moves: keeping it aside would need the no-replace rename the
  portable layout lacks.
- Document the fallback, its refusals and FreeBSD limits.
- TEST_rename_exdev_publication, TEST_rename_exdev_portable and
  tests.cpp cover publication rollback, shadows, collisions,
  ownership, sticky directories, mixed source types, a refused portable
  directory destination and the portable layout through a mounted
  pool. TEST_rename_exdev_publication keeps its fixture if its tmpfs
  can't be detached.

Performance: an ordinary rename only adds an lstat per read-only
branch, and only when one is configured. The fallback adds about two
lstats per branch plus the staging work, and fallback renames run one
at a time.
2026-11-29 23:11:10 -05:00
..
branches-mount-timeout.md docs: clarify branch resolution and mount ordering 2026-09-21 13:46:38 -05:00
branches.md docs: clarify branch resolution and mount ordering 2026-09-21 13:46:38 -05:00
cache.md fix: make the statfs cache correct and its timeout configurable 2026-11-29 23:11:06 -05:00
deprecated_options.md Document advisory locking limitation and update deprecated options 2026-05-06 20:49:46 -04:00
export-support.md Add config option to control default_permissions 2025-04-25 16:34:39 -05:00
flush-on-close.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00
follow-symlinks.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00
func_readdir.md fix: keep readdir listings stable under fill errors 2026-11-29 23:11:07 -05:00
functions_categories_policies.md Preserve directory modes when cloning paths across branches 2026-11-04 19:25:10 -06:00
fuse-msg-size.md Update fuse-msg-size docs (#1552) 2025-10-24 23:34:28 -05:00
inodecalc.md Add details to docs about FreeBSD limitations 2025-05-09 21:18:20 -05:00
kernel-permissions-check.md idmap mount support (#1523) 2025-09-18 00:07:28 -05:00
lazy-umount-mountpoint.md Add lazy-umount-mountpoint page and mount -a FAQ (#1573) 2025-11-12 12:19:00 -06:00
link-cow.md Config options docs updates (#1551) 2025-10-24 22:31:04 -05:00
link-exdev.md fix: make the rename-exdev fallback safe and transactional 2026-11-29 23:11:10 -05:00
minfreespace.md Add doc pages for minfreespace and moveonenospc + other misc updates 2025-04-10 22:59:49 -05:00
moveonenospc.md fix: pick the moveonenospc source and destination correctly 2026-11-29 23:10:59 -05:00
nfsopenhack.md fix: restore the mode when an nfsopenhack open fails 2026-11-29 23:11:01 -05:00
nullrw.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00
options.md fix: validate and cap thread and queue counts 2026-11-29 23:11:00 -05:00
passthrough.md Config options docs updates (#1551) 2025-10-24 22:31:04 -05:00
pin-threads.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00
proxy-ioprio.md Rework config, centralize fuse config (#1547) 2025-10-24 08:20:29 -05:00
readahead.md Config options docs updates (#1551) 2025-10-24 22:31:04 -05:00
rename-exdev.md fix: make the rename-exdev fallback safe and transactional 2026-11-29 23:11:10 -05:00
rename_and_link.md fix: make the rename-exdev fallback safe and transactional 2026-11-29 23:11:10 -05:00
statfs.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00
symlinkify.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00
threads.md fix: validate and cap thread and queue counts 2026-11-29 23:11:00 -05:00
xattr.md Rework mkdocs based documentation 2025-01-03 12:17:26 -06:00