efipart_strategy is using wrong offset with >512B sectors

The strategy() calls are assuming 512B sectors, so we need to adjust the
offset accordingly.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D12849
This commit is contained in:
tsoome 2017-11-01 18:49:45 +00:00
parent e5cf015156
commit e2cc4cefe2

View File

@ -877,7 +877,11 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size,
bcd.dv_cache = pd->pd_bcache;
if (dev->d_dev->dv_type == DEVT_DISK) {
return (bcache_strategy(&bcd, rw, blk + dev->d_offset,
daddr_t offset;
offset = dev->d_offset * pd->pd_blkio->Media->BlockSize;
offset /= 512;
return (bcache_strategy(&bcd, rw, blk + offset,
size, buf, rsize));
}
return (bcache_strategy(&bcd, rw, blk, size, buf, rsize));