Both SCSI and virtio expect the physical block size relative to the
logical block size. So get the factor first before calculating the
log2.
Reported-by: Mike Cao <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
{
unsigned int exp = 0, size;
- for (size = conf->physical_block_size; size > 512; size >>= 1) {
+ for (size = conf->physical_block_size;
+ size > conf->logical_block_size;
+ size >>= 1) {
exp++;
}