+29
−2
Loading
If bdev module reports ENOMEM for the first I/O in an I/O channel, all
subsequent I/Os would be queued in the nomem list. In this case,
io_outstanding and nomem_threshold would remain 0, allowing nomem I/Os
to be resubmitted unconditionally.
Now, a coming reset could trigger nomem I/O resubmission when aborting
nomem I/Os in the following path:
```
bdev_reset_freeze_channel
-> bdev_abort_all_queued_io
-> spdk_bdev_io_complete
-> _bdev_io_handle_no_mem
-> bdev_ch_retry_io
```
Both bdev_abort_all_queued_io and bdev_ch_retry_io modifies nomem_io
list in this path. Thus, there might be I/Os that are firstly submitted
to the underlying device by bdev_ch_retry_io, and then get aborted by
bdev_abort_all_queued_io, resulting in double-completion of these I/Os
later.
To fix this, just do not resubmit nomem I/Os when aborting is in
progress.
Change-Id: I1f66262216885779d1a883ec9250d58a13d8c228
Signed-off-by:
Jinlong Chen <chenjinlong.cjl@alibaba-inc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25522
Community-CI: Mellanox Build Bot
Reviewed-by:
Jim Harris <jim.harris@nvidia.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by:
Aleksey Marchuk <alexeymar@nvidia.com>