Spdk/test/unit/lib/bdev
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
..
bdev_zone.c bdev/zone: add support for get num zones 2021-04-26 16:16:42 +00:00
bdev.c bdev: Add extended versions of readv/writev 2021-08-20 07:26:10 +00:00
compress.c test/compress: fix Wstringop-overflow warnings 2021-07-07 07:27:01 +00:00
crypto.c thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
gpt module/bdev_gpt: remove spdk prefix from static/internal functions. 2020-05-15 07:58:03 +00:00
mt mk/unit: link with trace library 2021-06-10 10:58:05 +00:00
nvme bdev_nvme: Use new extended API 2021-08-20 07:26:10 +00:00
part.c mk/unit: link with trace library 2021-06-10 10:58:05 +00:00
pmem remove unneeded spdk_internal/thread.h includes 2020-12-10 14:38:04 +00:00
raid thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
scsi_nvme.c ut: make use of CUnit macro to reduce duplications 2020-04-02 14:50:12 +00:00
vbdev_lvol.c bdev/lvol: remove lvs with lvols during application shutdown 2021-08-20 07:27:58 +00:00
vbdev_zone_block.c thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
Makefile ut/bdev_ocssd: Move bdev_ocssd_ut from bdev directory to bdev/nvme directory 2021-02-09 11:29:53 +00:00