{
  "slug": "falloc-fl-insert-range",
  "term": "FALLOC_FL_INSERT_RANGE",
  "aliases": [
    "insert range",
    "fallocate --insert-range"
  ],
  "definition": "The Linux insert-range operation inserts a hole inside a Linux file, shifts existing data right and increases the file size.",
  "note": "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. [range-uapi]\n\nBoundaries: 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. [fallocate]\n\nInterface: 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. [range-cli] [range-vfs]\n\nPersistence: retaining payload while moving offsets does not establish crash-atomic editing. Applications still need an appropriate synchronization and recovery protocol. [fsync]\n\nObserved 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. [range-cursor]",
  "related": [
    "falloc-fl-collapse-range",
    "hole-punching",
    "sparse-file",
    "file-size",
    "file-offset"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-12-05",
  "citations": [
    {
      "id": "range-uapi",
      "title": "Linux v6.12: fallocate range-mode contracts",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.12/include/uapi/linux/falloc.h",
      "accessed": "2026-12-05"
    },
    {
      "id": "fallocate",
      "title": "Linux man-pages: fallocate(2), range boundaries and mode restrictions",
      "url": "https://man7.org/linux/man-pages/man2/fallocate.2.html",
      "accessed": "2026-12-05"
    },
    {
      "id": "range-cli",
      "title": "util-linux v2.41.2: fallocate command options",
      "url": "https://raw.githubusercontent.com/util-linux/util-linux/v2.41.2/sys-utils/fallocate.1.adoc",
      "accessed": "2026-12-05"
    },
    {
      "id": "range-vfs",
      "title": "Linux v6.12: vfs_fallocate flag validation",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.12/fs/open.c",
      "accessed": "2026-12-05"
    },
    {
      "id": "fsync",
      "title": "Linux man-pages: fsync(2), data and metadata synchronization",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-12-05"
    },
    {
      "id": "hesela-capacity",
      "title": "Hesela: Sparse files, preallocation and thin-pool capacity",
      "url": "https://hesela.com/analyses/sparse-files-preallocation-thin-capacity/",
      "accessed": "2026-12-05"
    },
    {
      "id": "range-cursor",
      "title": "Hesela: Native range transformation and cursor observation",
      "url": "https://hesela.dev/research/range-cursor/README.md",
      "accessed": "2026-12-05"
    }
  ],
  "provenance": [
    "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."
  ]
}
