Spdk/lib
Jim Harris d33497d3f4 thread: defer unregistration when for_each ops exist
There may be for_each operations outstanding on an
io_device when it is unregistered.  Currently we just
return when this happens, not unregistering the
device but also not notifying the caller that this
happened (since it returns void, and the callback
function doesn't have a status parameter either).

We could just push this responsibility to the caller,
to never unregister an io_device if it knows it has
outstanding for_each calls waiting to complete.  But
I think we can simplify this a lot by just handling
this inside of the thread library.  Mark that the
device is pending registration, and unregister it
(on the original requesting thread!) when the
for_each count gets back to zero.  Also don't
allow any new for_each operations either.

Note this requires a bit of refactoring on the
thread unit tests, since it is now possible to
unregister a device with outstanding for_each
operations.

Fixes issue #2631.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I978f2d99a25e65d2b7d71ce9b1926a79a6c94263
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13890
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-08-09 08:27:15 +00:00
..
accel lib/accel: Add new RPC to get valid engine info. 2022-08-03 07:53:21 +00:00
bdev bdev/qos: Process whole QoS queue on every Qos poll 2022-07-26 08:33:45 +00:00
blob lib/blob: Fix deleting a snapshot after decoupling it from its parent 2022-08-05 08:30:30 +00:00
blobfs blobfs: rename tree.h to cache_tree.h 2022-07-21 07:03:26 +00:00
conf Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
dma check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
env_dpdk check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
env_ocf check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
event event: require opts->name is set 2022-08-05 10:48:42 +00:00
ftl FTL: move assert earlier before accessing the field 2022-08-08 13:48:28 +00:00
idxd idxd: rename internal header file to idxd_internal.h 2022-07-21 07:03:26 +00:00
init Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ioat check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
iscsi check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
json check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
jsonrpc check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
log Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
lvol blobstore: implement spdk_bs_grow and bdev_lvol_grow_lvstore RPC 2022-06-28 17:55:43 +00:00
nbd check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
notify Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nvme nvme: Add transport controller ready step 2022-08-04 07:29:03 +00:00
nvmf lib/nvmf: don't raise assertion in nvmf_tgt_destroy_cb 2022-08-04 07:29:27 +00:00
rdma Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
reduce check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
rocksdb Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
rpc Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
scsi lib/scsi: use bkdr hash to avoid naa identifier collision 2022-08-03 07:43:10 +00:00
sock sock: Add ktls and tls_version to spdk_sock_impl_opts 2022-07-22 06:41:39 +00:00
thread thread: defer unregistration when for_each ops exist 2022-08-09 08:27:15 +00:00
trace Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
trace_parser Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ut_mock Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
util util: Extract a common lib between iovs and buf. 2022-06-20 10:01:15 +00:00
vfio_user lib/vfio_user: change the calculation of bar_addr 2022-06-15 08:10:32 +00:00
vhost vhost/rpc: return errno from virtio_blk_create_transport 2022-07-11 07:41:22 +00:00
virtio module/bdev_virtio_scsi: use the correct num_queues value 2022-08-04 11:24:40 +00:00
vmd vmd: rename internal header file to vmd_internal.h 2022-07-21 07:03:26 +00:00
Makefile ftl: core structure 2022-07-11 07:23:58 +00:00