The bdev hot remove might be an async process. The bdev_open will return an error during the hot remove process. If someone invoke the bdev_get_bdevs API when a bdev is in the middle of a hot remove process, the spdk_for_each_bdev function will stop its loop when a bdev_open return an error. Thus the bdev_get_bdevs will only return partual bdevs or even return an empty list if the hot remove bdev is the first bdev in the loop. When spdk_for_each_bdev and spdk_for_each_bdev_leaf loop for each bdevs, if a bdev returns an error, we skip that bdev instead of stop the whole loop. Signed-off-by: Peng Yu <yupeng0921@gmail.com> Change-Id: Ib35b817e23e47569fc5762a883b4ff8e322ae173 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15322 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Mike Gerdts <mgerdts@nvidia.com> Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> |
||
---|---|---|
.. | ||
bdev_internal.h | ||
bdev_rpc.c | ||
bdev_zone.c | ||
bdev.c | ||
Makefile | ||
part.c | ||
scsi_nvme.c | ||
spdk_bdev.map | ||
vtune.c |