lkml.org 
[lkml]   [2006]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RFC] splice support
On Thu, Mar 30 2006, Andrew Morton wrote:
> Jens Axboe <axboe@suse.de> wrote:
> >
> > > The one-at-a-time logic looks OK from a quick scan. Do we have logic in
> > > there to check that we're not overrunning i_size? (See the pain
> > > do_generic_mapping_read() goes through).
> >
> > do_splice_to() checks that, should I move that checking further down in
> > case the file is truncated?
>
> Again, see do_generic_mapping_read()'s ghastly tricks - it checks i_size
> after each readpage().
>
> i_size can increase or decrease under our feet if we're not holding i_mutex
> (and we don't want to). So userspace is being silly and the main things we
> need to care about here are to not leak uninitialised data and to not oops.
> A readpage() outside i_size will return either all-zeroes or some valid
> data which isn't actually within i_size any more, so I guess we're OK.

So from the looks of things, worst case is returning zeroes if we
'raced' with someone truncating the file. I'll just leave it as-is for
now.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-30 12:41    [W:0.054 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site