]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme/tcp: fix bug on double requeue when send fails
authorAnton Eidelman <anton@lightbitslabs.com>
Mon, 10 Feb 2020 18:37:18 +0000 (10:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:13 +0000 (16:45 +0100)
commit8e78f2db52256535ee4e400ce10e4252746b5252
treecd74497464cc443369aaaa334c9c84825897bc1f
parent4b4182a3e522b0780c0915336256bd59fd6d9c92
nvme/tcp: fix bug on double requeue when send fails

[ Upstream commit 2d570a7c0251c594489a2c16b82b14ae30345c03 ]

When nvme_tcp_io_work() fails to send to socket due to
connection close/reset, error_recovery work is triggered
from nvme_tcp_state_change() socket callback.
This cancels all the active requests in the tagset,
which requeues them.

The failed request, however, was ended and thus requeued
individually as well unless send returned -EPIPE.
Another return code to be treated the same way is -ECONNRESET.

Double requeue caused BUG_ON(blk_queued_rq(rq))
in blk_mq_requeue_request() from either the individual requeue
of the failed request or the bulk requeue from
blk_mq_tagset_busy_iter(, nvme_cancel_request, );

Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/tcp.c