lib/bdev: Change completion status of I/O aborted by reset from FAILED to ABORTED
Using not FAILED but ABORTED for the completion status of the I/Os aborted by reset will be reasonable and is done in this patch. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I8c8181dd33453a330888cffa93505e6fc462f278 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2708 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
5bc400f382
commit
8d4b319c98
@ -2035,7 +2035,7 @@ _bdev_io_submit(void *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bdev_ch->flags & BDEV_CH_RESET_IN_PROGRESS) {
|
if (bdev_ch->flags & BDEV_CH_RESET_IN_PROGRESS) {
|
||||||
_bdev_io_complete_in_submit(bdev_ch, bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
_bdev_io_complete_in_submit(bdev_ch, bdev_io, SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
} else if (bdev_ch->flags & BDEV_CH_QOS_ENABLED) {
|
} else if (bdev_ch->flags & BDEV_CH_QOS_ENABLED) {
|
||||||
if (spdk_unlikely(bdev_io->type == SPDK_BDEV_IO_TYPE_ABORT) &&
|
if (spdk_unlikely(bdev_io->type == SPDK_BDEV_IO_TYPE_ABORT) &&
|
||||||
bdev_abort_queued_io(&bdev->internal.qos->queued, bdev_io->u.abort.bio_to_abort)) {
|
bdev_abort_queued_io(&bdev->internal.qos->queued, bdev_io->u.abort.bio_to_abort)) {
|
||||||
@ -2629,7 +2629,7 @@ bdev_abort_all_buf_io(bdev_io_stailq_t *queue, struct spdk_bdev_channel *ch)
|
|||||||
bdev_io = STAILQ_FIRST(queue);
|
bdev_io = STAILQ_FIRST(queue);
|
||||||
STAILQ_REMOVE_HEAD(queue, internal.buf_link);
|
STAILQ_REMOVE_HEAD(queue, internal.buf_link);
|
||||||
if (bdev_io->internal.ch == ch) {
|
if (bdev_io->internal.ch == ch) {
|
||||||
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
} else {
|
} else {
|
||||||
STAILQ_INSERT_TAIL(&tmp, bdev_io, internal.buf_link);
|
STAILQ_INSERT_TAIL(&tmp, bdev_io, internal.buf_link);
|
||||||
}
|
}
|
||||||
@ -2660,7 +2660,7 @@ bdev_abort_all_queued_io(bdev_io_tailq_t *queue, struct spdk_bdev_channel *ch)
|
|||||||
ch->io_outstanding++;
|
ch->io_outstanding++;
|
||||||
ch->shared_resource->io_outstanding++;
|
ch->shared_resource->io_outstanding++;
|
||||||
}
|
}
|
||||||
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ stub_submit_request(struct spdk_io_channel *_ch, struct spdk_bdev_io *bdev_io)
|
|||||||
io = TAILQ_FIRST(&ch->outstanding_io);
|
io = TAILQ_FIRST(&ch->outstanding_io);
|
||||||
TAILQ_REMOVE(&ch->outstanding_io, io, module_link);
|
TAILQ_REMOVE(&ch->outstanding_io, io, module_link);
|
||||||
ch->outstanding_cnt--;
|
ch->outstanding_cnt--;
|
||||||
spdk_bdev_io_complete(io, SPDK_BDEV_IO_STATUS_FAILED);
|
spdk_bdev_io_complete(io, SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
ch->avail_cnt++;
|
ch->avail_cnt++;
|
||||||
}
|
}
|
||||||
} else if (bdev_io->type == SPDK_BDEV_IO_TYPE_ABORT) {
|
} else if (bdev_io->type == SPDK_BDEV_IO_TYPE_ABORT) {
|
||||||
@ -621,13 +621,13 @@ io_during_reset(void)
|
|||||||
CU_ASSERT(rc == 0);
|
CU_ASSERT(rc == 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A reset is in progress so these read I/O should complete with failure. Note that we
|
* A reset is in progress so these read I/O should complete with aborted. Note that we
|
||||||
* need to poll_threads() since I/O completed inline have their completion deferred.
|
* need to poll_threads() since I/O completed inline have their completion deferred.
|
||||||
*/
|
*/
|
||||||
poll_threads();
|
poll_threads();
|
||||||
CU_ASSERT(status_reset == SPDK_BDEV_IO_STATUS_PENDING);
|
CU_ASSERT(status_reset == SPDK_BDEV_IO_STATUS_PENDING);
|
||||||
CU_ASSERT(status0 == SPDK_BDEV_IO_STATUS_FAILED);
|
CU_ASSERT(status0 == SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
CU_ASSERT(status1 == SPDK_BDEV_IO_STATUS_FAILED);
|
CU_ASSERT(status1 == SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Complete the reset
|
* Complete the reset
|
||||||
@ -1002,8 +1002,8 @@ io_during_qos_reset(void)
|
|||||||
poll_threads();
|
poll_threads();
|
||||||
|
|
||||||
CU_ASSERT(reset_status == SPDK_BDEV_IO_STATUS_SUCCESS);
|
CU_ASSERT(reset_status == SPDK_BDEV_IO_STATUS_SUCCESS);
|
||||||
CU_ASSERT(status0 == SPDK_BDEV_IO_STATUS_FAILED);
|
CU_ASSERT(status0 == SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
CU_ASSERT(status1 == SPDK_BDEV_IO_STATUS_FAILED);
|
CU_ASSERT(status1 == SPDK_BDEV_IO_STATUS_ABORTED);
|
||||||
|
|
||||||
/* Tear down the channels */
|
/* Tear down the channels */
|
||||||
set_thread(1);
|
set_thread(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user