]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch
authorMeir Elisha <meir.elisha@volumez.com>
Wed, 26 Feb 2025 07:28:12 +0000 (09:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:03 +0000 (13:02 +0100)
commitbc11b1f617d74cf7fcc4813d1dbb7a84aeb20526
tree8efbd65c4e6f91625fff7cb905d14b9f31854f25
parent9fbc953d6b38bc824392e01850f0aeee3b348722
nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch

[ Upstream commit a16f88964c647103dad7743a484b216d488a6352 ]

The order in which queue->cmd and rcv_state are updated is crucial.
If these assignments are reordered by the compiler, the worker might not
get queued in nvmet_tcp_queue_response(), hanging the IO. to enforce the
the correct reordering, set rcv_state using smp_store_release().

Fixes: bdaf13279192 ("nvmet-tcp: fix a segmentation fault during io parsing error")
Signed-off-by: Meir Elisha <meir.elisha@volumez.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/tcp.c