You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libnvme: propagate the error to the caller if nvme_get_log_page() fails
The nvme_get_log_page() function may return an NVMe status code on failure,
leaving the errno number set to zero.
The nvme_discovery_log() function wasn't
propagating this error information to its caller; it would just return
NULL without setting a meaningful errno value.
the NULL pointer is interpreted as an error by nvme-cli, it then tries
to print the string associated to the errno value, resulting
in a funny output:
failed to get discovery log: Success
Fix this by capturing the status code returned by
nvme_get_log_page(), converting it to an errno value using
nvme_status_to_errno(), and setting errno before returning.
Additionally, the error message has been improved to include the
NVMe status code and the log level has been raised from
LOG_INFO to LOG_ERR.
Signed-off-by: Maurizio Lombardi <[email protected]>
0 commit comments