tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: disklabel(8) allows addressing non-existent space

On Sat, Dec 31, 2011 at 07:08:10AM +0900, Izumi Tsutsui wrote:
> Maybe he says about old i386/disksubr.c which had a magic number "2":
> >>    int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
> in bounds_check_with_label(),

That is the test I was thinking of. Of course, the kernel has a
'hunt the label' scheme - so that may not be where the label came from.

> and I agree there was no particular
> reason to have RAW_PART==3 to handle MBR partition.

I suspect it is historic - because the sector numbers were once
relative to the mbr partition (making the mbr partition much more like
the disk of earlier ports).
Then something had to be added to allow access to the entire disk.
Probably at a later time the sector number is the netbsd label were
made absolute...


David Laight:

Home | Main Index | Thread Index | Old Index