lkml.org 
[lkml]   [2004]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] VFS readahead bug in 2.6.8-rc[1-3]
Nick Piggin wrote:
> Ram Pai wrote:
>
>>
>> there is a check in __do_page_cache_readahead() that validates this.
>> But it is still not guaranteed to work correctly against races.
>> The filesystem has to handle such out-of-bound requests gracefully.
>>
>> However with Nick's fix in do_generic_mapping_read() the filesystem is
>> gauranteed to be called with out-of-bound index, if the file size is a
>> multiple of 4k. Without the fix, the filesystem might get
>> called with out-of-bound index only in racy conditions.
>>
>
> How's this?
>

It doesn't work. It correctly handles the case where *ppos is equal
to i_size on entry to the function (and this does work for files 0, 4k
and n * 4k in length), but it doesn't handle readahead inside the for
loop. The check needs to be in the for loop.

-
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: 2005-03-22 14:05    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog