Sign in

← Software

lseek(SEEK_DATA/SEEK_HOLE) ignores dirty mmap pages

titlelseek(SEEK_DATA/SEEK_HOLE) ignores dirty mmap pages
recommendationinclude
directionboth-differ
areareliability
feature flag
openzfs version2.2.0
summaryOpenZFS flushes mmap()'d pages before answering SEEK_DATA/SEEK_HOLE (de198f2d9, 2.2.0; made synchronous in 102b468b5, 2.3.0). illumos never took this, so a file just written through MAP_SHARED reads as one big hole and sparse-aware cp copies zeros. Solnix carries its own fix as kernel patch 0009-zfs-seek-hole-flush-mmap.patch.
impactWithout the patch, binaries linked by Go's linker (mmap output) and copied by GNU cp came out with zeroed records. Solnix already ships the fix; illumos-gate does not.
whyKeep the Solnix patch and upstream it to illumos-gate. Related open issue: 16092 (ZFS _FIO_SEEK_HOLE could use more work).
effortsmall
sourceshttps://github.com/openzfs/zfs/commit/de198f2d9507b6dcf3d0d8f037ba33940208733e
https://codeberg.org/solnix/solnix/src/commit/e71a9f8852b9af6e292c4cc852d6a00ffe98bf74/scripts/patches/0009-zfs-seek-hole-flush-mmap.patch
https://github.com/openzfs/zfs/commit/102b468b5e190973fbaee6fe682727eb33079811
https://www.illumos.org/issues/16092

What Solnix has done

  1. in-progress Maintainer approved 2026-11-17: offer Solnix patch 0009 (flush mmap'd pages before SEEK_DATA/SEEK_HOLE; OpenZFS de198f2d9 + 102b468b5) to illumos-gate. Still unfixed on illumos master (zfs_holey has no flush). Issue + review prepared; see the illumos submission. (maintainer)
  2. in-progress Offered to illumos-gate: issue #18752, review code.illumos.org 5298 (fix + regression test mmap_seek_001_pos; Imported from OpenZFS de198f2d9507 102b468b5e19). Awaiting review. (maintainer)

Objections (0)

None.

Sign in to object to this item.