Skip to content

Commit

Permalink
8748 loader: ptblread() is broken with >512B sectors
Browse files Browse the repository at this point in the history
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
tsoome authored and richlowe committed Nov 2, 2017
1 parent a37235a commit 13a5079
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions usr/src/boot/sys/boot/common/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t offset)
dev = (struct disk_devdesc *)d;
od = (struct open_disk *)dev->d_opendata;

/*
* The strategy function assumes the offset is in units of 512 byte
* sectors. For larger sector sizes, we need to adjust the offset to
* match the actual sector size.
*/
offset *= (od->sectorsize / 512);
/*
* As the GPT backup partition is located at the end of the disk,
* to avoid reading past disk end, flag bcache not to use RA.
Expand Down

0 comments on commit 13a5079

Please sign in to comment.