Patch "nvme-tcp: avoid repeated request completion" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nvme-tcp: avoid repeated request completion

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvme-tcp-avoid-repeated-request-completion.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b4874757afdcf07896d76dbdb4a62a0f1e10fbe6
Author: Sagi Grimberg <sagi@xxxxxxxxxxx>
Date:   Thu Oct 22 10:15:31 2020 +0800

    nvme-tcp: avoid repeated request completion
    
    [ Upstream commit 0a8a2c85b83589a5c10bc5564b796836bf4b4984 ]
    
    The request may be executed asynchronously, and rq->state may be
    changed to IDLE. To avoid repeated request completion, only
    MQ_RQ_COMPLETE of rq->state is checked in nvme_tcp_complete_timed_out.
    It is not safe, so need adding check IDLE for rq->state.
    
    Signed-off-by: Sagi Grimberg <sagi@xxxxxxxxxxx>
    Signed-off-by: Chao Leng <lengchao@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 76440f26c1453..a31c6e1f6063a 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2071,7 +2071,7 @@ static void nvme_tcp_complete_timed_out(struct request *rq)
 	struct nvme_ctrl *ctrl = &req->queue->ctrl->ctrl;
 
 	nvme_tcp_stop_queue(ctrl, nvme_tcp_queue_id(req->queue));
-	if (!blk_mq_request_completed(rq)) {
+	if (blk_mq_request_started(rq) && !blk_mq_request_completed(rq)) {
 		nvme_req(rq)->status = NVME_SC_HOST_ABORTED_CMD;
 		blk_mq_complete_request(rq);
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux