Skip to content

Commit 6357380

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme-tcp: fix bogus request completion when failing to send AER
AER is not backed by a real request, hence we should not incorrectly assume that when failing to send a nvme command, it is a normal request but rather check if this is an aer and if so complete the aer (similar to the normal completion path). Cc: [email protected] Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 00e757b commit 6357380

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/nvme/host/tcp.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,15 @@ static inline void nvme_tcp_done_send_req(struct nvme_tcp_queue *queue)
913913

914914
static void nvme_tcp_fail_request(struct nvme_tcp_request *req)
915915
{
916-
nvme_tcp_end_request(blk_mq_rq_from_pdu(req), NVME_SC_HOST_PATH_ERROR);
916+
if (nvme_tcp_async_req(req)) {
917+
union nvme_result res = {};
918+
919+
nvme_complete_async_event(&req->queue->ctrl->ctrl,
920+
cpu_to_le16(NVME_SC_HOST_PATH_ERROR), &res);
921+
} else {
922+
nvme_tcp_end_request(blk_mq_rq_from_pdu(req),
923+
NVME_SC_HOST_PATH_ERROR);
924+
}
917925
}
918926

919927
static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)

0 commit comments

Comments
 (0)