Skip to content

nvme-discoverd: fix a crash on a failed discovery log read - #4491

Open
martin-belanger wants to merge 2 commits into
linux-nvme:masterfrom
martin-belanger:discoverd-dlp-status
Open

martin-belanger wants to merge 2 commits into
linux-nvme:masterfrom
martin-belanger:discoverd-dlp-status

Conversation

@martin-belanger

Copy link
Copy Markdown
Collaborator

nvme-discoverd crashed when a Discovery Log Page read failed with an
NVMe status, e.g. a host path error from a DC that is not live yet.
libnvmf_get_discovery_log() returns that status as a positive value,
and nvme-discoverd treated it as success with no log page.

  • libnvme: the doc comment now names the positive NVMe status.
  • nvme-discoverd: convert the status to an errno, so the read fails and
    the DLP is read again at the next event. New handover test.

Affects 3.2 and 3.3.

Martin Belanger added 2 commits December 4, 2026 06:20
libnvmf_get_discovery_log() returns the positive NVMe status when the
controller answers a Get Log Page command with an error, as
libnvme_get_log() does. Its comment said it returns only negative
error codes.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
libnvmf_get_discovery_log() returns a negative errno or, when the
controller answers with an error, the positive NVMe status, for
example a host path error from a controller that is not live.
nvme-discoverd took a positive value for success and processed a log
page it never got: it crashed.

Convert the status to an errno, so the read counts as failed and the
DLP is read again at the next event.

Fixes: 0ec54f7 ("discoverd: read discovery logs without blocking")
Signed-off-by: Martin Belanger <martin.belanger@dell.com>

This branch has not been deployed

No deployments
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.

1 participant