falloc-fl-insert-range · shipping · also insert range, fallocate --insert-range

FALLOC_FL_INSERT_RANGE

The Linux insert-range operation inserts a hole inside a Linux file, shifts existing data right and increases the file size.

Transformation: inserting length L at offset O moves existing bytes at O and above to offsets larger by L. Logical length grows by L. Equal aligned chunks ABCD become A(hole)BCD when inserting before B; existing payload is retained on success. [1]

Boundaries: O must be nonnegative and strictly below old EOF, with positive L. O+L need not fit inside the old file, but the resulting size must respect filesystem limits. Support and alignment are filesystem-dependent. No other mode flag, including KEEP_SIZE, is allowed. [2]

Interface: util-linux exposes --insert-range (-i). A hole insertion differs from overwriting existing bytes with zeros or preallocating their storage. Linux v6.12 uses EOPNOTSUPP for conflicting modes; a manual's errno list is not universal. [3] [4]

Persistence: retaining payload while moving offsets does not establish crash-atomic editing. Applications still need an appropriate synchronization and recovery protocol. [5]

Observed offset trap: a bounded Linux/ext4 probe kept the open-file position at byte 8192 while collapse changed its next byte from C to D and insert from C to B. This is one environment, not a portability guarantee. [7]

Relations

related
FALLOC_FL_COLLAPSE_RANGE, Hole punching, Sparse file, File size, File offset

Citations

  1. Linux v6.12: fallocate range-mode contracts (accessed 2026-12-05)
  2. Linux man-pages: fallocate(2), range boundaries and mode restrictions (accessed 2026-12-05)
  3. util-linux v2.41.2: fallocate command options (accessed 2026-12-05)
  4. Linux v6.12: vfs_fallocate flag validation (accessed 2026-12-05)
  5. Linux man-pages: fsync(2), data and metadata synchronization (accessed 2026-12-05)
  6. Hesela: Native range transformation and cursor observation (accessed 2026-12-05)

Further reading

  1. Hesela: Sparse files, preallocation and thin-pool capacity (accessed 2026-12-05)
Sources & caveats
  • Primary-documentation synthesis with logical illustrations and a separately scoped native Linux/ext4 byte-and-cursor probe; not a performance or crash measurement.
  • Pinned Linux v6.12 and util-linux v2.41.2 sources do not establish support for every filesystem configuration.

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

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. FALLOC_FL_INSERT_RANGE. Hesela. 2026-12-05. https://hesela.dev/terms/falloc-fl-insert-range/