]> www.infradead.org Git - nvme.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)
committerKeith Busch <kbusch@kernel.org>
Fri, 28 Feb 2025 02:20:27 +0000 (18:20 -0800)
commita16f88964c647103dad7743a484b216d488a6352
tree9540ee4959b8ca466d3259391021e4222460bc2d
parentad95bab0cd28ed77c2c0d0b6e76e03e031391064
nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch

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>
drivers/nvme/target/tcp.c