[pull] master from linux-nvme:master#208
Merged
Merged
Conversation
added 5 commits
May 11, 2026 19:05
The libnvme_submit_[admin|io]_passthru interface has so far been a synchronous call. By making this call asynchronous when io_uring is supported and adding libnvme_wait_[admin|io]_passthru, the API becomes asynchronous. The main use case is to submit a command and wait for the response. Thus, libnvme_exec_[admin|io]_passthru is introduced. In the absence of io_uring, the code uses the kernel's standard ioctl interface (synchronous call). Update all in-tree call sites that do not require the split-phase API to use the new exec wrappers. Signed-off-by: Martin Belanger <martin.belanger@dell.com> Assisted-by: Claude:claude-sonnet-4-6 [Claude Code] [wagi: merged three patches into this one and updated commit message] Signed-off-by: Daniel Wagner <wagi@kernel.org>
libnvme_ctrl_get_transport_handle() can return NULL when the lazy-open in libnvme_open() fails (e.g. during device teardown). Guard both passthru submit entry points so callers do not have to check for a NULL handle. Signed-off-by: Martin Belanger <martin.belanger@dell.com> Assisted-by: Claude:claude-sonnet-4-6 [Claude Code]
Pre-existing bug flagged by Copilot review: libnvme_wait_admin_passthru() drained io_uring completions without inspecting cqe->res. The kernel writes the NVMe command status into cqe->res (0 on success, positive NVMe status code, negative errno on submission error), so discarding it caused command failures to be silently swallowed and callers like libnvme_get_log() to report success with invalid data. Accumulate the first non-zero cqe->res across all completions and return it after the ring is fully drained. Signed-off-by: Martin Belanger <martin.belanger@dell.com> Assisted-by: Claude:claude-sonnet-4-6 [Claude Code]
Introduce __unused in compiler-attributes.h and annotate hdl in the no-op wait stubs to suppress -Wunused-parameter. Since __unused is defined via __attribute__((__unused__)) — the very macro checkpatch would prefer we avoid here — suppress PREFER_DEFINED_ATTRIBUTE_MACRO in .checkpatch.conf with an explanatory comment. Because musl names in stat.h a struct member __unused, move the compiler-attributes include after the project includes in util-fabrics.c. Signed-off-by: Martin Belanger <martin.belanger@dell.com> Assisted-by: Claude:claude-sonnet-4-6 [Claude Code] [wagi: splitted this patch from previous patch] Signed-off-by: Daniel Wagner <wagi@kernel.org>
…open_uring() Pre-existing bug flagged by Copilot review: after calling libnvme_open_uring(), uring_state was left as LIBNVME_IO_URING_STATE_UNKNOWN regardless of the outcome. Every subsequent handle opened on the same ctx would fall through the UNKNOWN case again, re-enter libnvme_open_uring(), allocate a new ring, overwrite ctx->ring, and leak the previous one. Set uring_state to AVAILABLE on success and NOT_AVAILABLE on failure so the state machine works as intended. Signed-off-by: Martin Belanger <martin.belanger@dell.com> Assisted-by: Claude:claude-sonnet-4-6 [Claude Code]
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )