Page MenuHomeFreeBSD

loader: disk_open() should honor D_PARTNONE
ClosedPublic

Authored by tsoome on Jun 3 2019, 11:16 AM.
Tags
None
Referenced Files
F151919288: D20501.id.diff
Sat, Apr 11, 1:00 PM
F151844174: D20501.id.diff
Sat, Apr 11, 1:28 AM
F151816727: D20501.id.diff
Fri, Apr 10, 8:52 PM
Unknown Object (File)
Wed, Apr 8, 2:49 AM
Unknown Object (File)
Sun, Apr 5, 10:53 PM
Unknown Object (File)
Sun, Apr 5, 2:47 PM
Unknown Object (File)
Mon, Mar 23, 1:50 AM
Unknown Object (File)
Sun, Mar 22, 5:08 AM
Subscribers
None

Details

Summary

The D_PARTNONE is documented to make it possible to open raw MBR
partition, but the current disk_open() does not really implement this
statement.

The current code is checking partition against -1 (D_PARTNONE) but does
attempt to open partition table in case we do have FreeBSD MBR partition type.
Instead, we should check -2 (D_PARTWILD).

In case we do have MBR + BSD label, this code is only working because
by default, the first BSD partiton is created starting with relative sector
0, and we can still access the BSD table from that MBR slice.

Diff Detail

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

Event Timeline

I think this is good, thought I thought'd I'd committed the PARTWILD stuff already. Are there more places I/we've missed?

stand/common/disk.c
315 ↗(On Diff #58190)

I thought I'd already committed this change...

This revision is now accepted and ready to land.Jun 3 2019, 3:12 PM
This revision was automatically updated to reflect the committed changes.