Subject: Re: Filesystems vs. device sector sizes
To: None <tech-kern@netbsd.org>
From: Stephen M. Rumble <stephen.rumble@utoronto.ca>
List: tech-kern
Date: 07/27/2007 22:33:18
Quoting Stephen M. Rumble <stephen.rumble@utoronto.ca>:

> I had originally assumed that I was just getting lucky in being able  
>  to mount the file system and that something more fundamental was   
> keeping it from working, hence why I started this thread. It now   
> appears that there may be a bug somewhere else. I'll have to look  
> into  this further.

It appears that cd(4) will attempt to transfer 66k when it gets a 64k  
request that's not 2048b aligned. The end result is piixide reporting  
lost interrupts. I don't know why that occurs when MAXPHYS is  
exceeded, but it does.

The fix should be simple, but I'm getting a little bit confused by a  
few things...

First, what's the function of cdminphys if it's only called by paths  
going through cdread and cdwrite (which don't appear to be the case  
for ubc and the buffer cache)? Could that lead to problems where  
cdminphys should be restricting transfers, like in the case of  
CDF_ANCIENT?

Second, it looks like VOP_STRATEGY (at least how it's used in specfs)  
assumes that the strategy routine will not do partial transfers. Is  
this true? Should I be splitting the transfers in the cdstrategy  
routine to compensate? Is there a reason why this differs from  
physio(9), which allows partial transfers and apparently goes to the  
trouble of handling them.

Steve