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: stable@vger.kernel.org Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 00e757b commit 6357380

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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)