Re: [PATCH] sector_t overflow in block layer

Andrew Morton <[email protected]>
Newsgroups gmane.comp.file-systems.ext2.devel,gmane.linux.kernel
Message-ID <[email protected]>
"Stephen C. Tweedie" <[email protected]> wrote:
>
> Hi,
> 
> On Thu, 2006-05-18 at 17:23 -0600, Andreas Dilger wrote:
> 
> > I looked at that also, but it isn't clear from the use of "b_size" here
> > that there is any constraint that b_size is a power of two, only that it
> > is a multiple of 512.  Granted, I don't know whether there are any users
> > of such a crazy thing, but the fact that this is in bytes instead of a
> > shift made me think twice.
> 
> Yeah.  It was very strongly constrained to a power-of-two in the dim and
> distant past, when buffer_heads were only ever used for true buffer-
> cache data (the entire IO path had to be special-cased for IO that
> wasn't from the buffer cache, such as swap IO.)  
> 
> But more recently it has been a lot more relaxed, and we've had patches
> like Jens' "varyIO" patches on 2.4 which routinely generated odd-sized
> b_size buffer_heads when doing raw/direct IO on unaligned disk offsets.
> 
> But in 2.6, I _think_ such paths should be going straight to bio, not
> via submit_bh.  Direct IO certainly doesn't use bh's any more, and
> pretty much any other normal disk IO paths are page-aligned.  I might be
> missing something, though.
> 

We use various values of b_size when using a buffer_head for gathering a
disk mapping.  See, for example, fs/direct-io.c:get_more_blocks().

I don't think we ever play such tricks when a bh is used as an IO
container.  But we might - I see nothing in submit_bh() which would prevent
it.



btw, it seems odd to me that we're trying to handle the
device-too-large-for-sector_t problem at the submit_bh() level.  What
happens if someone uses submit_bio()?  Isn't it something we can check at
mount time, or partition parsing, or...?


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.