public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Phillip Lougher <phillip@lougher.demon.co.uk>
Cc: linuxram@us.ibm.com, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@osdl.org>,
	viro@parcelfarce.linux.theplanet.co.uk
Subject: Re: [PATCH] VFS readahead bug in 2.6.8-rc[1-3]
Date: Sat, 07 Aug 2004 05:09:34 +1000	[thread overview]
Message-ID: <4113D76E.9060906@yahoo.com.au> (raw)
In-Reply-To: <4113BA65.8050901@lougher.demon.co.uk>

Phillip Lougher wrote:
> 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.
> 
> 

I don't quite follow. What is i_size, *ppos, and desc->count
required for your problem to trigger?

  parent reply	other threads:[~2004-08-06 19:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44.0408052104420.2241-100000@dyn319181.beaverton.ibm.com>
     [not found] ` <411322E8.4000503@yahoo.com.au>
2004-08-06 10:47   ` [PATCH] VFS readahead bug in 2.6.8-rc[1-3] Ram
2004-08-06 17:05   ` Phillip Lougher
2004-08-06 18:02     ` Ram Pai
2004-08-06 19:09     ` Nick Piggin [this message]
2004-08-06 19:39       ` Phillip Lougher
2004-08-06 20:21         ` Nick Piggin
2004-08-05 17:50 Phillip Lougher
2004-08-06  0:55 ` Nick Piggin
2004-08-06  2:19   ` Nick Piggin
2004-08-06 16:58     ` Phillip Lougher
2004-08-06 18:58       ` Nick Piggin
2004-08-06 19:14         ` Phillip Lougher
2004-08-06 19:31           ` viro
2004-08-06 19:18         ` Phillip Lougher
2004-08-06 19:46           ` Andrew Morton
2004-08-07 14:21         ` Pozsar Balazs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4113D76E.9060906@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=phillip@lougher.demon.co.uk \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox