Page MenuHomeFreeBSD

loader: disk_open() should honor D_PARTNONE
ClosedPublic

Authored by tsoome on Jun 3 2019, 11:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 10, 5:33 PM
Unknown Object (File)
Sun, Feb 9, 4:14 PM
Unknown Object (File)
Jan 17 2025, 7:36 PM
Unknown Object (File)
Dec 13 2024, 12:08 AM
Unknown Object (File)
Dec 12 2024, 5:24 PM
Unknown Object (File)
Dec 3 2024, 3:08 AM
Unknown Object (File)
Dec 2 2024, 10:54 PM
Unknown Object (File)
Nov 30 2024, 3:28 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.