bdev: prevent aborting reqs doing push/pull or accel seq exec
Requests that have their data pushed/pulled from a memory domain or have an accel sequence executed aren't handled by a bdev module, so we shouldn't submit an abort request. Those operations cannot be aborted either, so the abort request is failed in this case. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: Icd185c4a2951a555d321cd037de0af1ab157f37a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17020 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
250566568a
commit
d69e6f64b3
@ -6488,6 +6488,20 @@ bdev_abort_io(struct spdk_bdev_desc *desc, struct spdk_bdev_channel *channel,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
bdev_io_on_tailq(struct spdk_bdev_io *bdev_io, bdev_io_tailq_t *tailq)
|
||||||
|
{
|
||||||
|
struct spdk_bdev_io *iter;
|
||||||
|
|
||||||
|
TAILQ_FOREACH(iter, tailq, internal.link) {
|
||||||
|
if (iter == bdev_io) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
_bdev_abort(struct spdk_bdev_io *parent_io)
|
_bdev_abort(struct spdk_bdev_io *parent_io)
|
||||||
{
|
{
|
||||||
@ -6523,6 +6537,13 @@ _bdev_abort(struct spdk_bdev_io *parent_io)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We can't abort a request that's being pushed/pulled or executed by accel */
|
||||||
|
if (bdev_io_on_tailq(bio_to_abort, &channel->io_accel_exec) ||
|
||||||
|
bdev_io_on_tailq(bio_to_abort, &channel->io_memory_domain)) {
|
||||||
|
parent_io->internal.status = SPDK_BDEV_IO_STATUS_FAILED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
rc = bdev_abort_io(desc, channel, bio_to_abort, bdev_abort_io_done, parent_io);
|
rc = bdev_abort_io(desc, channel, bio_to_abort, bdev_abort_io_done, parent_io);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
if (rc == -ENOMEM) {
|
if (rc == -ENOMEM) {
|
||||||
|
Loading…
Reference in New Issue
Block a user