{
  "slug": "fiemap",
  "term": "FIEMAP",
  "aliases": [
    "FS_IOC_FIEMAP"
  ],
  "definition": "A Linux ioctl interface that reports file extent mappings and associated state flags over a requested logical byte range.",
  "note": "FIEMAP_FLAG_SYNC synchronizes before mapping, so the query can alter the observed state. DELALLOC also sets UNKNOWN; UNWRITTEN instead describes allocated zero-reading storage. Mappings can change between calls and are not permission to access a mounted filesystem through its block device. Record request flags and check for a full output buffer. Hesela's linked observation compares unsynchronized queries with explicit fsync and FIEMAP synchronization. In upstream Linux v6.8, fiemap_prep uses filemap_write_and_wait rather than fsync for this flag; it is not a substitute for a metadata-durability barrier.",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    "A count-only query is not a stable snapshot for the following mapping call.",
    "Returned extents may cross the requested range; LAST can be range-scoped on some implementations."
  ],
  "related": [
    "file-extent",
    "delayed-allocation",
    "unwritten-extent",
    "fsync"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-16",
  "citations": [
    {
      "id": "fiemap-interface",
      "title": "Linux 6.12: FIEMAP ioctl, flags and access restrictions",
      "url": "https://docs.kernel.org/6.12/filesystems/fiemap.html",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-observer",
      "title": "Hesela: measured FIEMAP observer intervention",
      "url": "https://hesela.com/analyses/sparse-files-preallocation-thin-capacity/#observer",
      "accessed": "2026-10-16"
    },
    {
      "id": "fiemap-writeback",
      "title": "Linux v6.8 fs/ioctl.c: fiemap_prep writeback implementation",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.8/fs/ioctl.c",
      "accessed": "2026-10-16"
    }
  ]
}
