Skip to content

[pull] master from linux-nvme:master#208

Merged
pull[bot] merged 5 commits into
zengqingfu1442:masterfrom
linux-nvme:master
May 11, 2026
Merged

[pull] master from linux-nvme:master#208
pull[bot] merged 5 commits into
zengqingfu1442:masterfrom
linux-nvme:master

Conversation

@pull

@pull pull Bot commented May 11, 2026

Copy link
Copy Markdown

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 : )

Martin Belanger 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]
@pull pull Bot locked and limited conversation to collaborators May 11, 2026
@pull pull Bot added the ⤵️ pull label May 11, 2026
@pull pull Bot merged commit 95008f0 into zengqingfu1442:master May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants