diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d806743..123c8dbd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,9 @@ parameter in spdk_bdev_get_opts function. Two fields `small_buf_pool_size` and the small and large buffer pool size of the whole bdev module. A new API `spdk_bdev_wait_for_examine` was added to allow for checking state of -examine process. Along with corresponding `bdev_wait_for_examine` RPC. +examine process. Along with corresponding `bdev_wait_for_examine` RPC, which +is now always called during `spdk_bdev_subsystem_config_json` making sure +every bdev is ready to be used. ### blob diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index 63e38c834..8d19532f8 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -1152,6 +1152,11 @@ spdk_bdev_subsystem_config_json(struct spdk_json_write_ctx *w) pthread_mutex_unlock(&g_bdev_mgr.mutex); + /* This has to be last RPC in array to make sure all bdevs finished examine */ + spdk_json_write_object_begin(w); + spdk_json_write_named_string(w, "method", "bdev_wait_for_examine"); + spdk_json_write_object_end(w); + spdk_json_write_array_end(w); } diff --git a/test/json_config/config_filter.py b/test/json_config/config_filter.py index 6c6d2748c..d19a3165b 100755 --- a/test/json_config/config_filter.py +++ b/test/json_config/config_filter.py @@ -29,6 +29,7 @@ def filter_methods(do_remove_global_rpcs): 'nvmf_set_max_subsystems', 'nvmf_create_transport', 'bdev_set_options', + 'bdev_wait_for_examine', 'bdev_nvme_set_options', 'bdev_nvme_set_hotplug', 'sock_impl_set_options',