Add spdk_bdev_abort function as a new public API. This goes all the way down to the bdev driver module and attempts to abort all I/Os which has bio_cb_arg as its callback argument. We can separate when only a single I/O has bio_cb_arg and when multiple I/Os have bio_cb_arg, but unify both by using parent - children I/O relationship. To avoid confusion, return matched_ios by _bdev_abort() and store it into split_outstanding by the caller. Exclude any I/O submitted after this abort command because the same cb_arg may be used by all I/Os and abort may never complete. bdev_io needs to have both bio_cb_arg and bio_to_abort because bio_cb_arg is used to continue abort processing when it is stopped due to the capacity of bdev_io pool, and bio_to_abort is used to pass it to the underlying bdev module at submission. Parent I/O is not submitted directly, and is only used in the generic bdev layer, and parent I/O's bdev_io uses bio_cb_arg. Hence add bio_cb_arg to bdev structure and add bio_to_abort to abort structure. In the meantime of abort operation, target I/Os may be completed. Hence check if the target I/O still exists at completion, and set the completion status to false only if it still exists. Upon completion of this, i.e., this returned zero, the status SPDK_BDEV_IO_STATUS_SUCCESS indicates all I/Os were successfully aborted, or the status SPDK_BDEV_IO_STATUS_FAILED indicates any I/O was failed to abort by any reason. spdk_bdev_abort() does not support aborting abort or reset request due to the complexity for now. Following patches will support I/O split case. Add unit tests together to cover the basic paths. Besides, ABI compatibility check required us to bump up SO version of a few libraries or modules. Bump up SO version of blob bdev module simply because it does not have any out-of-tree consumer, and suppress bumping up SO version of lvol library because the affected struct spdk_lvol is not part of public APIs. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I515da688503557615d491bf0bfb36322ce37df08 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2014 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> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
46 lines
1.8 KiB
Makefile
46 lines
1.8 KiB
Makefile
#
|
|
# BSD LICENSE
|
|
#
|
|
# Copyright (c) Intel Corporation.
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions
|
|
# are met:
|
|
#
|
|
# * Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# * Redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in
|
|
# the documentation and/or other materials provided with the
|
|
# distribution.
|
|
# * Neither the name of Intel Corporation nor the names of its
|
|
# contributors may be used to endorse or promote products derived
|
|
# from this software without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
#
|
|
|
|
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
|
|
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
|
|
|
SO_VER := 3
|
|
SO_MINOR := 0
|
|
|
|
C_SRCS = blob_bdev.c
|
|
LIBNAME = blob_bdev
|
|
|
|
SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_blob_bdev.map)
|
|
|
|
include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
|