mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <news-innominate.list.linux.kernel@innominate.de>
To: paulus@linuxcare.com.au
To: linux-kernel@vger.kernel.org
Subject: Re: page->mapping == 0
Date: Sun, 29 Oct 2000 13:39:50 +0100	[thread overview]
Message-ID: <news2mail-39FC1A96.F2D5C47D@innominate.de> (raw)
In-Reply-To: <14841.7644.853174.666385@argo.linuxcare.com.au> 	<Pine.LNX.4.10.10010262325440.864-100000@penguin.transmeta.com> <14843.61434.167836.293141@argo.linuxcare.com.au>

Paul Mackerras wrote:
> I am not any kind of expert on the page cache but it seems to me that
> maybe after locking the page we should check if it is still the page
> we want (i.e. page->mapping and page->index are still correct), and go
> back and look up the page again if not.  Presumably there will be
> quite a few places besides do_generic_file_read where that check would
> be needed also.

I'm getting at least some kind of clue about the page cache, though I
don't claim to be an expert.  You've pointed out how the operation of
becoming a reader on a page can fail because the page disappears while
you're waiting.  That's an error, right?  It's the result of a user
space race, which in turn is the result of parallel processes doing
nonatomic file operations with no synchronization.  It sounds like
bailing out of the file_read if the page turns out to be unmapped after
the lock is the right thing to do, at least for a quick fix.

  http://lxr.linux.no/source/mm/filemap.c?v=2.4.0-test9#L1029

There actually aren't that many places where lock_page is called:

  http://lxr.linux.no/ident?v=2.4.0-test9;i=lock_page

Maybe lock_page needs to return an error code.

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

  reply	other threads:[~2000-10-29 12:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.10.10010262325440.864-100000@penguin.transmeta.com>
     [not found] ` <14841.7644.853174.666385@argo.linuxcare.com.au>
2000-10-29  9:38   ` Paul Mackerras
2000-10-29 12:39     ` Daniel Phillips [this message]
2000-10-29 18:05     ` Linus Torvalds
2000-10-29 18:32       ` Alexander Viro
2000-10-29 19:12         ` Linus Torvalds
2000-10-29 19:33           ` Linus Torvalds
2000-10-30  1:57             ` Daniel Phillips
2000-10-29 20:32         ` Alan Cox
2000-10-29 20:42           ` Alexander Viro
2000-10-29 22:26           ` Jeff V. Merkey
2000-10-29 23:12           ` Jeff Dike

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=news2mail-39FC1A96.F2D5C47D@innominate.de \
    --to=news-innominate.list.linux.kernel@innominate.de \
    --cc=paulus@linuxcare.com.au \
    --cc=phillips@innominate.de \
    /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

all inboxes | Powered by JetHome®