bdev/aio: use detected block size as AIO block device data alignment
Currently we provide a warning to users that the specified block size doen not match auto-detected for AIO device, e.g.: the AIO device uses 512B as the block size while users input 4096B when creating SPDK AIO block device. However, the data alignment required by kernel AIO device can use the auto-detected one, we are over-committed for the alignment requirement, so here just use the auto-detected block size. Fix issue #1478. Change-Id: Ia5d02bb66980cbe55ea7039488189d409315552e Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3495 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: GangCao <gang.cao@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
5d49baeb8e
commit
29bbb9ba9c
@ -656,7 +656,11 @@ create_aio_bdev(const char *name, const char *filename, uint32_t block_size)
|
||||
}
|
||||
|
||||
fdisk->disk.blocklen = block_size;
|
||||
fdisk->disk.required_alignment = spdk_u32log2(block_size);
|
||||
if (fdisk->block_size_override && detected_block_size) {
|
||||
fdisk->disk.required_alignment = spdk_u32log2(detected_block_size);
|
||||
} else {
|
||||
fdisk->disk.required_alignment = spdk_u32log2(block_size);
|
||||
}
|
||||
|
||||
if (disk_size % fdisk->disk.blocklen != 0) {
|
||||
SPDK_ERRLOG("Disk size %" PRIu64 " is not a multiple of block size %" PRIu32 "\n",
|
||||
|
Loading…
Reference in New Issue
Block a user