Page MenuHomeFreeBSD

loader: disk_open() should honor D_PARTNONE
ClosedPublic

Authored by tsoome on Jun 3 2019, 11:16 AM.
Tags
None
Referenced Files
F160758363: D20501.diff
Sat, Jun 27, 1:16 PM
Unknown Object (File)
Tue, Jun 16, 10:41 AM
Unknown Object (File)
May 26 2026, 8:47 PM
Unknown Object (File)
May 22 2026, 10:00 AM
Unknown Object (File)
May 22 2026, 9:43 AM
Unknown Object (File)
May 20 2026, 3:32 AM
Unknown Object (File)
May 4 2026, 1:00 PM
Unknown Object (File)
Apr 18 2026, 3:48 PM
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.