Blob Blame History Raw
From: Daniel Wagner <dwagner@suse.de>
Date: Wed, 10 Mar 2021 17:54:50 +0100
Subject: nvme: return an error if nvme_set_queue_count() fails
Patch-mainline: Never, upstream fix can't be backported
References: bsc#1180197

nvme_set_queue_count() is called during (re)connecting, where
on rdma the normal timeout handling rules are suspended and
a timeout will just cause the command to be aborted.
But a command timeout should in all cases trigger a controller
reset, so we must not ignore a failure here but return an
error code on timeout or path failure.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index aee4fffe7f9a..175f79bd10cd 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1237,7 +1237,7 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
 		*count = min(*count, nr_io_queues);
 	}
 
-	return 0;
+	return status;
 }
 EXPORT_SYMBOL_GPL(nvme_set_queue_count);
 
-- 
2.29.2