Page MenuHomeFreeBSD

loader biosdisk fix for 2+TB disks.

Authored by tsoome on Nov 20 2016, 9:51 PM.
Referenced Files
Unknown Object (File)
Sun, May 19, 11:57 PM
Unknown Object (File)
Sun, May 19, 11:55 PM
Unknown Object (File)
Sun, May 19, 9:32 PM
Unknown Object (File)
Sun, May 19, 5:15 PM
Unknown Object (File)
Mon, May 13, 11:18 PM
Unknown Object (File)
Sat, May 11, 7:34 AM
Unknown Object (File)
Fri, May 10, 3:04 PM
Unknown Object (File)
Wed, May 8, 9:40 PM



This fix is implementing partition based boundary check for
disk IO and updates disk mediasize (if needed), based on information
from partition table.

As it appeared, the signed int based approach still has corner cases,
and the wrapover based behavior is non-standard.

The idea for this fix is based on two assumptions:

  1. The bug about media size is hitting large (2+TB) disks, lesser disks

hopefully, are not affected.

  1. Large disks are using GPT (which does include information about disk size).

Since our concern is about boot support and boot disks are partitioned,
implementing partition boundaries based IO verification should make the
media size issues mostly disappear.

However, for large disk case, we do have the disk size available from GPT table.
If non-GPT cases will appear, we still can make approximate calculation about
disk size based on defined partition(s), however, this is not the objective
of this patch, and can be added later if there is any need.

This patch does implement disk media size adjustment (if needed) in bd_open(),
and boundary check in bd_realstrategy().

Test Plan

Tested by Stephen Hurd with 4TB disks.

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

tsoome retitled this revision from to loader biosdisk fix for 2+TB disks..
tsoome updated this object.
tsoome edited the test plan for this revision. (Show Details)
tsoome added reviewers: allanjude, imp.

Typos in comments (easy to fix).

397 ↗(On Diff #22377)


584 ↗(On Diff #22377)


In D8595#178619, @bcr wrote:

Typos in comments (easy to fix).

Fixed, thanks!

tsoome marked 2 inline comments as done.

off_t -> uint64_t

allanjude edited edge metadata.

Approved for commit

This revision is now accepted and ready to land.Feb 6 2017, 2:51 PM
This revision was automatically updated to reflect the committed changes.