Is your improvement request related to a feature? Please describe (👍 if you like this request)
When a bdev is created on a block device that’s already in use, existing data on it will be corrupted and lost. This can be dangerous if users accidentally specify the wrong device path.
This check is already handled implicitly for nvme, virtio-blk, and virtio-scsi drivers during device bind step using SPDK’s setup.sh script through the block_in_use function. However, this check is currently missing for the aio driver.
Describe the solution you'd like
Simply run blkid to check if the device has a partition table or filesystem, this is what the block_in_use function does. Reject the disk create request if the device is already in use.
Describe alternatives you've considered
No response
Additional context
No response
Is your improvement request related to a feature? Please describe (👍 if you like this request)
When a bdev is created on a block device that’s already in use, existing data on it will be corrupted and lost. This can be dangerous if users accidentally specify the wrong device path.
This check is already handled implicitly for
nvme,virtio-blk, andvirtio-scsidrivers during device bind step using SPDK’ssetup.shscript through theblock_in_usefunction. However, this check is currently missing for theaiodriver.Describe the solution you'd like
Simply run
blkidto check if the device has a partition table or filesystem, this is what theblock_in_usefunction does. Reject the disk create request if the device is already in use.Describe alternatives you've considered
No response
Additional context
No response