falloc-fl-unshare-range · shipping · also unshare range, preemptive copy-on-write

FALLOC_FL_UNSHARE_RANGE

FALLOC_FL_UNSHARE_RANGE makes shared file data private ahead of later writes, preserving existing content while preparing its copy-on-write allocation.

Allocation timing: a reflink postpones copying until a write diverges the files. This Linux fallocate mode brings that allocation forward for the selected range, trading immediate space and I/O for protection against later lack-of-space failures there. Success must be checked; unsupported filesystems can return EOPNOTSUPP and insufficient space can return ENOSPC. [1]

Mode boundaries: the Linux v6.16 UAPI assigns this flag 0x40 and describes content-preserving unsharing within file size. It belongs to allocation mode and cannot be combined with punch, zero, collapse or insert range modes. Filesystem-dependent granularity still applies. [2]

Checkpoint trade-off: famus_snap deliberately avoids reserving worst-case space for complete divergence of a backing file and its snapshot, because doing so could remove the sharing benefit. An application choosing that optimization must budget future copy-on-write growth separately. [3]

Persistence: allocating private extents does not flush future writes or durably publish a pathname. File synchronization and required directory synchronization remain separate obligations. [4]

Relations

related
Reflink, Copy-on-write (storage), File preallocation, File extent, fsync, Failure-atomic msync

Limitations

  • An unshare failure is not a capacity reservation; inspect the error before relying on subsequent writes. [1]
  • Neither private extents nor a cloned file provide an independent device-failure domain. [5]

Citations

  1. Linux man-pages: fallocate(2), unshare allocation mode and errors (accessed 2026-11-21)
  2. Linux v6.16: include/uapi/linux/falloc.h, unshare-range mode contract (accessed 2026-11-21)
  3. Terence Kelly. Good Old-Fashioned Persistent Memory. USENIX ;login:, Winter 2019, pp. 29-34. (accessed 2026-11-21)
  4. Linux man-pages: fsync(2), data, metadata and directory persistence (accessed 2026-11-21)
  5. Linux man-pages: FICLONE(2const), shared storage and later allocation (accessed 2026-11-21)

Further reading

  1. Hesela: Sparse files, preallocation and thin-pool capacity (accessed 2026-11-21)
Sources & caveats
  • Source synthesis of Linux interface contracts and a snapshot implementation, not a filesystem benchmark or crash-recovery experiment.
  • The flag's presence in a pinned UAPI header does not establish support on every filesystem or a date of first implementation.

JSON: /data/terms/falloc-fl-unshare-range.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. FALLOC_FL_UNSHARE_RANGE. Hesela. 2026-11-21. https://hesela.dev/terms/falloc-fl-unshare-range/