Skip to content

tree: open transport handle for the ns init fallback#3013

Closed
igaw wants to merge 1 commit intolinux-nvme:masterfrom
igaw:fix-nvme_ns_init-fallback
Closed

tree: open transport handle for the ns init fallback#3013
igaw wants to merge 1 commit intolinux-nvme:masterfrom
igaw:fix-nvme_ns_init-fallback

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented Dec 11, 2025

Older kernels do not expose the sysfs entries the library needs. In this in this case it falls back to use a command to fetch the missing data. Though, the transport handle is not available yet. Open an temporary one. No need to optimize this code path, it is only for older kernels.

Fixes: #3009

TODO: The tree API needs to be extended with the nvme_global_ctx argument

Older kernels do not expose the sysfs entries the library needs. In this
in this case it falls back to use a command to fetch the missing data.
Though, the transport handle is not available yet. Open an temporary
one. No need to optimize this code path, it is only for older kernels.

Signed-off-by: Daniel Wagner <[email protected]>
Comment thread libnvme/src/nvme/tree.c
ret = nvme_ns_identify(ns, id);
ret = nvme_open(ctx, ns->name, &hdl);
if (ret) {
nvme_msg(ctx, LOG_ERR, "need root permissions");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs \n at the end of the message string.

@igaw igaw closed this Jan 2, 2026
@igaw igaw deleted the fix-nvme_ns_init-fallback branch January 2, 2026 14:22
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.

2 participants