Skip to content

ZC WRITE_ZEROES must zero, not ACK 0 - #88

Merged
jaredLunde merged 3 commits into
beyondoss:mainfrom
paulocsanz:dst/zc-write-zeroes
Aug 14, 2026
Merged

ZC WRITE_ZEROES must zero, not ACK 0#88
jaredLunde merged 3 commits into
beyondoss:mainfrom
paulocsanz:dst/zc-write-zeroes

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

The device advertises max_write_zeroes_sectors (16 MiB). On the zero-copy path WRITE_ZEROES completed with 0 and never called handler.write_zeroes, so the guest saw success and read stale bytes. Two commits: tests that fail on main, then the fix.

  • Policy: WRITE_ZEROES runs the handler; DISCARD stays ACK-0 (max_discard_sectors is 0).
  • ZC dispatch spawns the same write_zeroes path USER_COPY already uses.

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
paulocsanz force-pushed the dst/zc-write-zeroes branch from 016b136 to 6be2771 Compare August 14, 2026 21:08
@jaredLunde
jaredLunde merged commit ab947a2 into beyondoss:main Aug 14, 2026
23 of 25 checks passed
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.

2 participants