diff options
author | Toomas Soome <tsoome@FreeBSD.org> | 2017-11-01 18:49:45 +0000 |
---|---|---|
committer | Toomas Soome <tsoome@FreeBSD.org> | 2017-11-01 18:49:45 +0000 |
commit | 9c103b4675e715cf35dc8014888ad87f279d58e8 (patch) | |
tree | 21b04ffdcc2b15ac47f4fe41a2757a217c9b3a57 /sys/boot/efi | |
parent | ad4e4ae591ec267918ac74bbd158626d4961b0f8 (diff) |
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
Notes
Notes:
svn path=/head/; revision=325286
Diffstat (limited to 'sys/boot/efi')
-rw-r--r-- | sys/boot/efi/libefi/efipart.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/boot/efi/libefi/efipart.c b/sys/boot/efi/libefi/efipart.c index c460cd5ad4ac..724233c5ab08 100644 --- a/sys/boot/efi/libefi/efipart.c +++ b/sys/boot/efi/libefi/efipart.c @@ -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)); |