Re: [PATCH] nvme-tcp: drop the queue's reference to a timed-out request
From: Yehyeong Lee
Date: Mon Nov 30 2026 - 05:49:12 EST
On Sun, 29 Nov 2026 12:15:37 +0900, I wrote:
> Closing the reference closes the second completion too, because that
> can only reach the request through the same two references.
That sentence is wrong, and I should not have written it. Going back
over the paths that still lead to the completed request turned up a
third one. nvmf_complete_timed_out_request() ends the request with
blk_mq_complete_request(), which never passes through
nvme_try_complete_req() - the only place the host advances
nvme_req(rq)->genctr. The command id is therefore still live in the
tagset: nvme_find_rq() accepts it on the generation alone and
nvme_cid_to_rq() checks nothing at all. The receive side of the
stopped queue is still open too, because SHUT_RD does not discard what
the socket has already received and the read_sock() path does not look
at the shutdown state, so a residual PDU can be resolved back onto the
request that was just completed.
I have not turned that into a crash - holding bytes unread past the
stop also makes the reconnect's freeze wait expire, so the controller
never reaches LIVE and nothing is dispatched to the stopped queue - but
that the command id still resolves to the completed request is
straightforward to observe through both lookups.
v2 drops the false sentence, describes that route, and adds the second
half of the fix: clearing rd_enabled in nvme_tcp_stop_queue_nowait(),
so a queue the host has given up on resolves no further command ids.
Please look at that one instead of this patch.
Superseded by v2: https://lore.kernel.org/linux-nvme/20261130104426.2140231-1-yhlee@xxxxxxxxxxxxxxxxxx/