Spdk/lib
Andrey Kuzmin 9abd8becc5 Avoid scheduling removal of the same bdev descriptor multiple times.
Deferred descriptor removal invocation under bdev_unregister() does
not account for the possibility of bdev_unregister being entered
multiple times for the same bdev (which is possible thanks to multiple
paths to unregistration - consider bdev hotremove callback and
_spdk_bdev_finish_unregister_bdevs_iter iterator - being present).
Therefore, currently nothing prevents _remove_notify for the same bdev
descriptor from being scheduled multiple times.

This commit adds boolean remove_scheduled field to struct spdk_bdev_desc.
The value is set when remove_notify for the descriptor is being
scheduled for the first time, and checked on subsequent attempts.

Change-Id: If2c5a365c05c4123c50edf5a2db164be9dd26f8e
Signed-off-by: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Reviewed-on: https://review.gerrithub.io/415319
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-15 17:47:05 +00:00
..
bdev Avoid scheduling removal of the same bdev descriptor multiple times. 2018-06-15 17:47:05 +00:00
blob blobstore: check return code in IO freeze completion 2018-06-15 00:35:09 +00:00
blobfs thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
conf conf: don't strdup name if section already exist 2018-05-17 17:13:19 +00:00
copy copy/ioat: Add scan_ioat_copy_engine RPC 2018-06-14 03:54:42 +00:00
cunit include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
env_dpdk env: add size parameter to spdk_mem_map_translate 2018-06-05 18:36:00 +00:00
event bdev: add set_bdev_options RPC 2018-06-14 14:57:11 +00:00
ioat scripts/check_format: check for spaces before tabs 2018-03-05 11:09:13 -05:00
iscsi iscsi: Refactor a few of loop and branch and remove unnecessary initialization 2018-06-14 03:35:28 +00:00
json json: Add spdk_json_decode_uint16 2018-06-05 21:30:02 +00:00
jsonrpc jsonrpc: fix closed connection hadling 2018-06-08 18:11:18 +00:00
log app: reword -t option help string 2018-06-11 23:37:11 +00:00
lvol thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
nbd thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
net rpc: Add state_mask to each RPC method to make sets of RPCs 2018-05-03 19:48:15 +00:00
nvme ocssd: check whether ctrlr support ocssd 2018-06-14 23:09:42 +00:00
nvmf nvmf: redundant spdk_nvmf_transport assignment 2018-06-14 17:44:27 +00:00
rocksdb thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
rpc rpc: Add option to get_rpc_methods RPC to output only currently usable RPCs 2018-05-04 17:45:48 +00:00
scsi thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
thread thread: add spdk_thread_get_count() 2018-06-13 00:38:41 +00:00
trace app,lib: fix checking mmap return value 2018-03-30 16:18:34 -04:00
ut_mock test/mock: add pthread_self 2017-09-19 17:15:15 -04:00
util thread: Move threading abstraction code out of util 2018-06-12 15:24:07 +00:00
vhost thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
virtio virtio: merge contiguous memory regions 2018-06-01 20:14:32 +00:00
Makefile thread: Move threading abstraction code out of util 2018-06-12 15:24:07 +00:00