On 5/12/21 4:23 PM, James Bottomley wrote:
No, we support physical sector sizes up to 4k. The logical block size
internal to the kernel and the block layer is always 512. I can see
the utility in using consistent naming to the block layer, but I can't
see that logical block address is confusing ... especially now
manufacturers seem all to have aligned on 512 for the logical block
size even when it's usually 4k physical.
Are we talking about the same? Just below the code that I included in my
previous email there is the following line:
blk_queue_logical_block_size(sdp->request_queue, sector_size);
where sector_size is the logical block size reported by the READ
CAPACITY command and has a value between 512 and 4096.
At least the LIO code supports reporting logical block sizes larger than
512 bytes. From drivers/target/target_core_sbc.c:
put_unaligned_be32(dev->dev_attrib.block_size, &buf[8]);
block_size is configurable through configfs. From block_size_store():
if (val != 512 && val != 1024 && val != 2048 && val != 4096) {
pr_err("dev[%p]: Illegal value for block_device: %u"
" for SE device, must be 512, 1024, 2048 or 4096\n",
da->da_dev, val);
return -EINVAL;
}
Bart.