ZC WRITE_ZEROES must zero, not ACK 0 - #88
Merged
Merged
Conversation
The device advertises max_write_zeroes_sectors. ACK-0 without zeroing is guest-visible silent wrong. DISCARD remains an advertised no-op.
DISCARD stays Complete(0) because max_discard_sectors is 0. WRITE_ZEROES follows the FLUSH pattern: deferred, run the same handler as USER_COPY.
paulocsanz
force-pushed
the
dst/zc-write-zeroes
branch
from
August 14, 2026 21:08
016b136 to
6be2771
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The device advertises
max_write_zeroes_sectors(16 MiB). On the zero-copy pathWRITE_ZEROEScompleted with 0 and never calledhandler.write_zeroes, so the guest saw success and read stale bytes. Two commits: tests that fail on main, then the fix.WRITE_ZEROESruns the handler;DISCARDstays ACK-0 (max_discard_sectorsis 0).write_zeroespath USER_COPY already uses.