Spdk/module/bdev/raid
yupeng df80e8ffc6 bdev/raid: stop the raid bdev in raid_bdev_destruct
The raid bdev may receive IO requests after the raid layer
invokes spdk_bdev_unregister function. This patch moves the
raid_bdev->module->stop to the raid_bdev_destruct function.
Then there will be no IO after the raid_bdev->module->stop
is invoked.
Below is a way to reproduce this issue:
(1) create a malloc bdev
sudo ./scripts/rpc.py bdev_malloc_create --name malloc0 128 4096
(2) create a concat bdev base on the malloc bdev
sudo ./scripts/rpc.py bdev_raid_create --name concat0 \
--raid-level concat --base-bdevs malloc0 --strip-size-kb 4
(3) create a lvstore base on the concat bdev
sudo ./scripts/rpc.py bdev_lvol_create_lvstore \
--cluster-sz 4194304 --clear-method unmap concat0 lvs0
(4) remove the concat bdev
sudo ./scripts/rpc.py bdev_raid_delete concat0
In the step(4), the spdk app will crash because an IO request
is sent to the concat bdev after the concat_stop is invoked.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I76d6964ee9528d4590ed86e9c5c28d53e85da32f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12221
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-13 08:33:19 +00:00
..
bdev_raid_rpc.c bdev/raid: remove deprecated parameter strip_size 2021-03-29 07:41:09 +00:00
bdev_raid.c bdev/raid: stop the raid bdev in raid_bdev_destruct 2022-04-13 08:33:19 +00:00
bdev_raid.h bdev/raid: Add concat module 2022-04-05 07:39:00 +00:00
concat.c bdev/raid: Add concat module 2022-04-05 07:39:00 +00:00
Makefile bdev/raid: Add concat module 2022-04-05 07:39:00 +00:00
raid0.c raid0: Use extended bdev rw API 2022-04-04 09:57:56 +00:00
raid5.c log: remove internal log.h header 2020-10-15 08:23:39 +00:00