Skip to content

Declare the holes of a sparse copy on Windows - #314

Merged
abrignoni merged 1 commit into
mainfrom
fix/windows-sparse-copies
Oct 26, 2026
Merged

abrignoni merged 1 commit into
mainfrom
fix/windows-sparse-copies

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Sparse copies on Windows were not staying sparse, which is what failed windows-smoke on #313.

  • Seeking over zeros is not a hole on NTFS. Once Windows writes the file out, it fills the gap before the next write. The copy now declares each hole with FSCTL_SET_ZERO_DATA.
  • The probe and the test now flush to disk before measuring, so the test no longer depends on timing.
  • On the Windows VM the test failed 50 of 50 against the old code and passes 50 of 50 now, with the bytes unchanged.

🤖 Generated with Claude Code

Seeking over a zero run does not leave a hole on NTFS: once the cached data is
written out, the gap before a later write is filled, so a copy's leading zero
run ended up allocated. The copy now ends with FSCTL_SET_ZERO_DATA over each
run it skipped on Windows, the probe writes and flushes the way a copy does,
and the test flushes before it measures, so the old code fails it every time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni merged commit 4414d42 into main Oct 26, 2026
8 checks passed
@abrignoni
abrignoni deleted the fix/windows-sparse-copies branch October 26, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant