nvme: compute number of requested log page words correctly - #1215
Merged
Conversation
rmustacc
approved these changes
Sep 11, 2026
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.
(foo & 0xFFF) >> 16is a rather doomed expression. this fixes the secondary issue I'd noticed in #1213, where log pages seemed to have random data in them from call to call.the field we're trying to extract here is
NUMDLin bits31:16of cdw10. basically all the symbols were right, just.. in the wrong order. the consequence here was that we were computing a log page request for 0 (meaning, 1) dword, and filling in the first four bytes of the request with zero. Linux has been requesting 127 (meaning, 128) dwords the entire time, to fill all 512 bytes of defined-and-reserved space in the log page.I don't know why this goes from being what I observed with garbage data in 22.04, to being zeroed later on. I assume that's a kernel change, since prp1 becomes always-aligned, and I assume that the kernel decides to zero the page to guard against misbehaving devices like ours that don't write all the bits they're supposed to!