提交 1e297c32 编写于 作者: C Christoph Hellwig 提交者: Kevin Wolf

block: fix physical_block_size calculation

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: NMike Cao <bcao@redhat.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 c7126d5b
......@@ -224,7 +224,9 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf)
{
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++;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册