Spdk/lib/nvmf
Konrad Sztyber b12419a231 tcp: don't abort requests waiting for R2T ACK
It is possible for requests waiting for R2T ACK to receive H2C PDU
before receiving the ACK.  Therefore, the following sequence:

1. Host sends a write request to the target.
2. Target sends R2T PDU to the host and sets request's state to
   AWAITING_R2T_ACK.
3. Host sends H2C PDU to the target, but it doesn't reach the target
   yet.
3. Host sends an abort command to abort that request.  Request's state
   is changed to READY_TO_COMPLETE.
4. Target receives the H2C PDU, sees that request's state is
   READY_TO_COMPLETE, which is unexpected, and terminates the
   connection.

will cause the target to terminate the connection, which is obviously
incorrect.

So, to avoid that, we can treat AWAITING_R2T_ACK state in the same way
as TRANSFERRING_HOST_TO_CONTROLLER and register a poller waiting for the
state to be changed.

Fixes #2789.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Idddc627050000b74663dba397dc14d10aa0e284f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16641
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:50:15 +00:00
..
ctrlr_bdev.c nvmf: sanity check passthru handlers 2023-01-30 16:28:35 +00:00
ctrlr_discovery.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
ctrlr.c nvmf: drop req->data usage in ctrlr.c 2023-01-30 16:28:35 +00:00
fc_ls.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
fc.c misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
Makefile so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
nvmf_fc.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf_internal.h nvmf: pause/resume polling for the target 2023-01-24 14:49:24 +00:00
nvmf_rpc.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf.c nvmf: Fix new line at the end of log message 2023-01-30 16:29:49 +00:00
rdma.c nvmf/rdma: use req->iov consistently 2023-01-30 16:28:35 +00:00
spdk_nvmf.map nvmf: pause/resume polling for the target 2023-01-24 14:49:24 +00:00
subsystem.c nvmf: Add ZNS specific identify functions for NVMe-oF ZNS support 2023-01-16 08:30:34 +00:00
tcp.c tcp: don't abort requests waiting for R2T ACK 2023-02-13 13:50:15 +00:00
transport.c nvmf/transport: fix spdk_nvmf_request_free_buffers() 2023-01-24 18:18:49 +00:00
transport.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
vfio_user.c nvmf/vfio-user: use req->iov consistently 2023-01-30 16:28:35 +00:00