Subject: Re: lseek(2) & read(2) on raw cd(4) device
To: Sean Doran <smd@ebone.net>
From: Ignatios Souvatzis <is@beverly.kleinbus.org>
List: tech-kern
Date: 08/25/2000 00:19:13
On Fri, Aug 25, 2000 at 12:10:18AM +0200, Sean Doran wrote:
> 
> | #         if (CDPART(bp->b_dev) != RAW_PART &&
> |
> | um, /dev/r?d[0-9]*[a-h] are raw partitions.
> | /dev/?d[0-9]*[a-h] are block partitions.
> 
> Uhm, "raw partitions" is a bad term; 'un-blocked interfaces' perhaps is clearer?
> 
> RAW_PART (see above) is defined in places like this:
> 
> ./arch/i386/include/disklabel.h:#define RAW_PART        3
>                /* raw partition: XX?d (XXX) */
> 
> ./arch/alpha/include/disklabel.h:#define        RAW_PART        2
> 	       /* raw partition: xx?c */
> 
> So, having learned alot about the "BSD way" of lseek versus vnodes,
> can anyone explain to me why we don't do bounds-checking on RAW_PART in
> cdstrategy/sdstrategy/etc.?

We can't because (at least for disks) we use it to read and write the disk
label, when there isn't any.

Regards,
	-is