bdev/error: do not submit an I/O that will be failed
If error injection is enabled and we choose an I/O to fail, do not submit the I/O and fail it when completed - just fail it immediately. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ib58513f66e0df22c36137c0adb273fc31066c983 Reviewed-on: https://review.gerrithub.io/362386 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
5fafd5c277
commit
8933ba2119
@ -68,16 +68,6 @@ spdk_vbdev_inject_error(uint32_t io_type_mask, uint32_t error_num)
|
||||
pthread_mutex_unlock(&g_vbdev_error_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
vbdev_error_task_complete(struct spdk_bdev_io *bdev_io, bool success,
|
||||
void *cb_arg)
|
||||
{
|
||||
struct spdk_bdev_io *bdevio = (struct spdk_bdev_io *)cb_arg;
|
||||
struct spdk_bdev_io *parent = bdevio->parent;
|
||||
|
||||
spdk_bdev_io_complete(parent, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
}
|
||||
|
||||
static void
|
||||
vbdev_error_reset(struct vbdev_error_disk *error_disk, struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
@ -98,7 +88,6 @@ vbdev_error_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev
|
||||
{
|
||||
struct vbdev_error_disk *error_disk = bdev_io->bdev->ctxt;
|
||||
uint32_t io_type_mask;
|
||||
struct spdk_bdev_io *child;
|
||||
|
||||
switch (bdev_io->type) {
|
||||
case SPDK_BDEV_IO_TYPE_READ:
|
||||
@ -128,9 +117,7 @@ vbdev_error_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev
|
||||
spdk_bdev_io_resubmit(bdev_io, error_disk->base_bdev);
|
||||
} else {
|
||||
g_error_num--;
|
||||
child = spdk_bdev_get_child_io(bdev_io, &error_disk->disk, vbdev_error_task_complete, NULL);
|
||||
child->ch = bdev_io->ch;
|
||||
spdk_bdev_io_resubmit(child, error_disk->base_bdev);
|
||||
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
}
|
||||
pthread_mutex_unlock(&g_vbdev_error_mutex);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user