nvme-fabrics: parse nvme connect Linux error codes

This fixes the assumption that errval is an unsigned nvme error

Signed-off-by: Amit Engel <amit.engel@dell.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Amit Engel 2022-08-01 21:40:39 +03:00 committed by Christoph Hellwig
parent 14446f9abd
commit ec9e96b523
1 changed files with 6 additions and 0 deletions

View File

@ -270,6 +270,12 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
{
int err_sctype = errval & ~NVME_SC_DNR;
if (errval < 0) {
dev_err(ctrl->device,
"Connect command failed, errno: %d\n", errval);
return;
}
switch (err_sctype) {
case NVME_SC_CONNECT_INVALID_PARAM:
if (offset >> 16) {