Spdk/lib
Shuhei Matsumoto db8bd99588 bdev/part: Add spdk_bdev_part_base_construct_ext() to pass bdev_name
Add an new API spdk_bdev_part_base_construct_ext() to pass not bdev but
bdev_name to fix the race condition due to the time gap between
spdk_bdev_get_by_name() and spdk_bdev_open(). A pointer to a bdev is
valid only while the bdev is opened.

In the new API, spdk_bdev_get_by_name() is included in
spdk_bdev_part_base_construct_ext() and the caller has to know if
the bdev exists or not. Hence spdk_bdev_part_base_construct_ext()
returns return code and returns the created part object by the double
pointer.

Another critical change is that base is just freed if spdk_bdev_open_ext()
failed with -ENODEV. The reason is that if we call spdk_bdev_part_base_free()
for that case, the configuration is removed by the registered callback
and so bdev_examine() will not work.

The following patches will replace spdk_bdev_part_base_construct()
by spdk_bdev_part_base_construct_ext() for the corresponding bdev
modules.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2db027a159559c403cdfbd71800afba590b0f328
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-10-16 08:14:34 +00:00
..
accel lib/accel: change task alloc from global mempool->per chan list 2020-08-21 08:25:04 +00:00
bdev bdev/part: Add spdk_bdev_part_base_construct_ext() to pass bdev_name 2020-10-16 08:14:34 +00:00
blob log: remove internal log.h header 2020-10-15 08:23:39 +00:00
blobfs log: remove internal log.h header 2020-10-15 08:23:39 +00:00
conf lib/conf: allow multiple sections with same name 2020-07-22 12:24:08 +00:00
env_dpdk env: spdk_vtophys buffer argument is now const 2020-10-13 07:48:05 +00:00
env_ocf log: remove internal log.h header 2020-10-15 08:23:39 +00:00
event log: remove internal log.h header 2020-10-15 08:23:39 +00:00
ftl log: remove internal log.h header 2020-10-15 08:23:39 +00:00
idxd log: remove internal log.h header 2020-10-15 08:23:39 +00:00
ioat log: remove internal log.h header 2020-10-15 08:23:39 +00:00
iscsi log: remove internal log.h header 2020-10-15 08:23:39 +00:00
json log: remove internal log.h header 2020-10-15 08:23:39 +00:00
jsonrpc log: remove internal log.h header 2020-10-15 08:23:39 +00:00
log log: remove internal log.h header 2020-10-15 08:23:39 +00:00
lvol log: remove internal log.h header 2020-10-15 08:23:39 +00:00
nbd log: remove internal log.h header 2020-10-15 08:23:39 +00:00
net log: remove internal log.h header 2020-10-15 08:23:39 +00:00
notify log: remove internal log.h header 2020-10-15 08:23:39 +00:00
nvme lib/nvme: Hold ctrlr->ctrlr_lock before calling nvme_ctrlr_fail 2020-10-15 08:24:47 +00:00
nvmf nvmf_rpc: remove a redundant '\n' 2020-10-15 08:24:55 +00:00
rdma log: remove internal log.h header 2020-10-15 08:23:39 +00:00
reduce log: remove internal log.h header 2020-10-15 08:23:39 +00:00
rocksdb test/blobfs: Drop .ini config in favor of json 2020-10-12 08:26:20 +00:00
rpc RPC: update the error message for current RPC state 2020-07-31 08:21:37 +00:00
rte_vhost read_fd_message: distinguish prints of log message 2020-05-25 09:08:00 +00:00
scsi log: remove internal log.h header 2020-10-15 08:23:39 +00:00
sock log: remove internal log.h header 2020-10-15 08:23:39 +00:00
thread log: remove internal log.h header 2020-10-15 08:23:39 +00:00
trace log: remove internal log.h header 2020-10-15 08:23:39 +00:00
ut_mock mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
util util: add spdk_bit_pool 2020-09-15 07:12:44 +00:00
vhost log: remove internal log.h header 2020-10-15 08:23:39 +00:00
virtio log: remove internal log.h header 2020-10-15 08:23:39 +00:00
vmd log: remove internal log.h header 2020-10-15 08:23:39 +00:00
Makefile event: move log_rpc contents to event library 2020-09-25 11:43:42 +00:00