Spdk/test/unit/lib
Tomasz Zawadzki d2dd47433b bdev/lvol: remove lvs with lvols during application shutdown
Once bdev finish starts, bdev unregister is called on all
unclaimed bdevs. This means that for lvs with at least one
lvol present, there will be a corresponding bdev unregister.

Yet the vbdev_lvol module does not attempt to unload the lvs,
once last lvol from that lvs is unregistered. Leaving
the base bdev for lvs claimed.

This patch fixes that by using fini_start callback from
bdev_module to mark when shutdown begins. After that
last lvol unregistered on lvs will unload it.

Expanded struct lvol_bdev to contain lvol_store_bdev.
Closing the lvol will free spdk_lvol, so lvol->lvol_store cannot
be accessed.

Changed ut_lvol_destroy UT to ut_bdev_finish. Previous UT didn't
really test vbdev_lvol_destroy, but 'hotremove' of the lvol bdev.
In effect there is no hotremove of the lvol bdevs (only lvs bdev).
spdk_bdev_unregister() can only be called from within vbdev_lvol,
or during bdev module finish.
This UT will now check the bdev module finish.

Note that at this point lvs with no lvols will not trigger
lvs unload. Next patches in series will introduce async fini_start,
to allow for the unload.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8f51e8c1fcfdc55a5d090a3bc84ccefda813aef8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9093
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-20 07:27:58 +00:00
..
accel thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
bdev bdev/lvol: remove lvs with lvols during application shutdown 2021-08-20 07:27:58 +00:00
blob blobstore: calculate correct num_md_clusters in bs_recover 2021-08-09 08:39:42 +00:00
blobfs thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
dma dma: Introduce memory domain 2021-08-20 07:26:10 +00:00
env_dpdk unit: add unit test for the pci event 2021-04-19 12:55:17 +00:00
event lib/event: do not set interrupt mode when eventfd is not supported 2021-08-13 07:21:33 +00:00
ftl thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
idxd idxd/rpc: Revise the rpc function to use kernel or user driver 2021-07-13 17:22:30 +00:00
init event: Shift subsystem initialization code to a separate library 2021-05-24 10:12:50 +00:00
ioat ut: make use of CUnit macro to reduce duplications 2020-04-02 14:50:12 +00:00
iscsi mk/unit: link with trace library 2021-06-10 10:58:05 +00:00
json json: add the spdk_json_write_uint128 function 2021-07-22 13:46:50 +00:00
jsonrpc lib/jsonrpc: remove spdk_ prefix from internal functions. 2020-05-11 12:29:07 +00:00
log log: simplify SPDK_LOG_REGISTER_COMPONENT 2020-10-14 08:00:35 +00:00
lvol thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
notify ut: make use of CUnit macro to reduce duplications 2020-04-02 14:50:12 +00:00
nvme nvme: Add functions spdk_nvme_ns_cmd_readv/writev_ext 2021-08-20 07:26:10 +00:00
nvmf unittest/nvmf_tcp: Test for nvmf_tcp_icreq_handle 2021-08-13 07:15:45 +00:00
reduce test: add generic unlink wrapper 2020-05-06 12:43:57 +00:00
scsi scsi: Delete mutex from spdk_scsi_globals 2021-06-17 08:59:18 +00:00
sock sock: Add sock_map_find_free 2021-04-22 07:29:26 +00:00
thread thread: speed up io_device lookup by using rbtree 2021-07-16 07:11:53 +00:00
util util/crc32c: Add spdk_crc32c_iov_update. 2021-06-02 11:37:17 +00:00
vhost lib/vhost: force cpumask to be subset of application's CPU mask 2021-02-04 08:35:08 +00:00
json_mock.c ut/json_mock: Add spdk_json_write_string_fmt() 2021-02-09 11:29:53 +00:00
Makefile dma: Introduce memory domain 2021-08-20 07:26:10 +00:00