public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Hugh Dickins <hugh@veritas.com>
Cc: Ram Pai <linuxram@us.ibm.com>, Gergely Tamas <dice@mfa.kfki.hu>,
	Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: data loss in 2.6.9-rc1-mm1
Date: Sun, 29 Aug 2004 11:30:08 +1000	[thread overview]
Message-ID: <413131A0.4070100@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.44.0408281519300.4593-100000@localhost.localdomain>

Hugh Dickins wrote:
> On Sat, 28 Aug 2004, Nick Piggin wrote:
> 
>>Ahh, yep - Hugh just forgot to also move the "nr" calculation
>>into the ->readpage path, so it hits twice on the fast path.
> 
> 
> Yes, your patch is better than mine.
> 
> 
>>What's more, it looks like mine handles the corner case of reading off the
>>end of a non-PAGE_SIZE file (but within the same page). I think yours will
>>drop through and do the ->readpage, while mine doesn't...?
> 
> 
> It's a common case, not a corner case: a short read to end of file,
> then app does another read which returns 0 for the end of file: that
> wouldn't normally fall through to readpage in Ram's case, but would
> do unnecessary page_cache_readahead (won't do much) and find_get_page.
> 

Ahh, yeah I guess that would be the more common case. I was just
thinking of just randomly reading past the end of the file - in
that case it *would* fall through to ->readpage if the page wasn't
in cache.

But anyway, I think we agree my (our) version should cover that.

> 
>>I agree. We'll leave it to someone else to decide, then ;)
> 
> 
> I vote for Nick's patch.
> 

OK - maybe that can go for a spin in the next -mm. Andrew did you
get it?

> I do have one reservation on do_generic_mapping_read,
> common to all these versions, unrelated to the current issue.
> 
> I'm surprised to notice that you're careful to re-i_size_read
> after readpage, but otherwise rely on the initial i_size_read.
> We could go around this loop many many times, faulting user pages
> in actor, rescheduling away: the old (e.g. 2.4 or 2.6.0) code was
> deficient after readpage, but at least it reassessed i_size each
> time around the loop.  I guess if the file is truncated meanwhile,
> the common case would be for a find_get_page to fail, and then the
> situation be corrected after readpage; perhaps it's more likely to
> show up as read returning too little on a large file being steadily
> appended.  Maybe you already ruled these cases out as not worth the
> overhead of handling, but it does surprise me that the old code was
> safer in this respect.
> 

Yeah I guess it is a case of doing the minimum that is really
needed.

Although considering page_cache_readahead call can do an i_size_read,
it might be nicer to probably change the interface to have it passed down
instead

  reply	other threads:[~2004-08-29  1:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 10:55 data loss in 2.6.9-rc1-mm1 Gergely Tamas
2004-08-27 11:05 ` Anton Altaparmakov
2004-08-27 11:40   ` Gergely Tamas
2004-08-27 12:35   ` Fabio Coatti
2004-08-27 11:17 ` Tim Schmielau
2004-08-27 11:43   ` Gergely Tamas
2004-08-27 11:37 ` Mikael Pettersson
2004-08-27 11:55 ` Denis Vlasenko
2004-08-27 13:56   ` Hugh Dickins
2004-08-27 14:18     ` Gergely Tamas
2004-08-27 15:36       ` Fabio Coatti
2004-08-27 18:30     ` Ram Pai
2004-08-27 19:08       ` Hugh Dickins
2004-08-27 21:04         ` Ram Pai
2004-08-28  4:35           ` Nick Piggin
2004-08-28  5:01             ` Ram Pai
2004-08-28  5:42               ` Andrew Morton
2004-08-28  5:54               ` Nick Piggin
2004-08-28  9:44                 ` Rafael J. Wysocki
2004-08-28  9:45                   ` Andrew Morton
2004-08-28 10:18                     ` Nick Piggin
2004-08-28 10:47                       ` Rafael J. Wysocki
2004-08-28 14:52                 ` Hugh Dickins
2004-08-29  1:30                   ` Nick Piggin [this message]
2004-08-31  6:25                     ` Ram Pai
2004-08-31  6:39                       ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2004-08-28 12:05 Joachim Bremer

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=413131A0.4070100@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=dice@mfa.kfki.hu \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /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