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)
Tue, Apr 16, 9:48 PM
Unknown Object (File)
Feb 23 2024, 3:23 PM
Unknown Object (File)
Feb 23 2024, 2:21 PM
Unknown Object (File)
Feb 23 2024, 2:21 PM
Unknown Object (File)
Feb 23 2024, 2:08 PM
Unknown Object (File)
Dec 21 2023, 8:36 AM
Unknown Object (File)
Oct 28 2023, 4:03 PM
Unknown Object (File)
Oct 12 2023, 2:24 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.