Skip to content

handle large discard/write_zeroes without buffer panic#18

Merged
jaredLunde merged 1 commit into
mainfrom
jared/ext4-thing
Mar 2, 2026
Merged

handle large discard/write_zeroes without buffer panic#18
jaredLunde merged 1 commit into
mainfrom
jared/ext4-thing

Conversation

@jaredLunde
Copy link
Copy Markdown
Contributor

Metadata-only ublk ops (DISCARD, WRITE_ZEROES, FLUSH) don't use the data
buffer, but dispatch_io was slicing the buffer to the request length before
checking the op type. Since max_discard_sectors allows 16MB requests against
a 512KB per-tag buffer, mkfs.ext4 discards panic on the slice bounds check.

Move the dispatch_passthrough call before the buffer slice, matching what
the zero-copy path already does.

@jaredLunde jaredLunde merged commit e9559f2 into main Mar 2, 2026
3 of 17 checks passed
@jaredLunde jaredLunde deleted the jared/ext4-thing branch March 2, 2026 04:03
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