Repository navigation
tree: read namespace UUID from the typed WWID - #1152
Merged
Merged
Conversation
The sysfs uuid attribute returns the NGUID when no UUID is available, so nvme_ns_get_uuid() can report an NGUID as a UUID. The kernel also warns when this compatibility fallback is read. Read wwid instead and decode only its uuid. form. The kernel has preferred the UUID in this attribute since before libnvme's minimum Linux v4.15, and the existing nguid attribute continues to provide the NGUID. Signed-off-by: ooonea <35407790+ooonea@users.noreply.github.com> Assisted-by: OpenAI Codex
Collaborator
|
Thanks! We need a similar fix in nvme-cli 3 as well |
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 namespace
uuidsysfs attribute falls back to the NGUID when no UUID is available. Consequently,nvme_ns_get_uuid()can return an NGUID as a UUID, and reading that compatibility attribute triggers a kernel warning.Decode the UUID from the
uuid.form ofwwidinstead. Linux v4.15 already prioritizes a real UUID inwwid, matching libnvme's minimum supported kernel. NGUID, EUI-64, vendor-specific and missing WWIDs leave the UUID empty; the independent NGUID attribute remains unchanged. This is separate from the string-decoding correction in #1115.Validated against the upstream Meson suite: 43 passes, two expected failures and zero failures. Synthetic UUID, NGUID, EUI-64, vendor, missing and malformed WWID cases passed, including the pre-6.8 Identify path with a mocked command. A 1.16.1 backport including #1115 kept both real local namespaces visible and preserved their NGUIDs; syscall tracing confirmed no legacy
uuidreads or NVMe device-node access. The full CI matrix was not run.Fixes #1151.
AI disclosure: OpenAI Codex assisted the investigation, implementation, test scripts and this description.