public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache
Date: Thu, 24 May 2007 15:46:11 -0700	[thread overview]
Message-ID: <20070524154611.080b38ed.akpm@linux-foundation.org> (raw)
In-Reply-To: <28590.1180046073@redhat.com>

On Thu, 24 May 2007 23:34:33 +0100
David Howells <dhowells@redhat.com> wrote:

> Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > So my reason for asking the above is to try to find a way to make all these
> > new PG-error games just go away.
> 
> Yeah.  However, there needs to be something to cover the gap between releasing
> PG_writeback and getting PG_lock.  They have to be done in that order to avoid
> deadlocking against truncate and other stuff, but that leaves a window in which
> the page appears to be in a good state - one in which prepare_write() or
> page_mkwrite() can potentially leak through.

hm.  I don't see why that race window would be a problem in practice: the
page-exciser does a lock_page();wait_on_page_writeback() as normal, then
proceeds with its business?

But given that this doesn't work right for some reason, can we use PG_error
and then handle that appropriately in the filesystem's ->prepare_write() and
->page_mkwrite()?

> Nick Piggin talked about using an extra lock, but as far as I can tell, that
> just compounds the deadlock problems.
> 
> I suppose I could leave something in page->private that indicated that the
> page was defunct, but that'd have to be done by the filesystem, probably
> before calling cancel_rejected_write().

Well, using PG_error is OK and appropriate for that if it's localised to
the fs.  But I'd be a bit worried about requiring that the VFS maintain
some special protocol for it, partly because it would be such a
rarely-tested thing.


  reply	other threads:[~2007-05-24 22:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23 19:15 [PATCH 1/4] AFS: Add TestSetPageError() David Howells
2007-05-23 19:15 ` [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache David Howells
2007-05-24 20:38   ` Andrew Morton
2007-05-24 21:35     ` David Howells
2007-05-24 21:47       ` Andrew Morton
2007-05-24 22:34         ` David Howells
2007-05-24 22:46           ` Andrew Morton [this message]
2007-05-24 23:08             ` David Howells
2007-05-24 23:24               ` Andrew Morton
2007-05-24 23:37                 ` David Howells
2007-05-24 22:35       ` Trond Myklebust
2007-05-24 23:18         ` David Howells
2007-05-24 23:54           ` Trond Myklebust
2007-05-30 10:35             ` David Howells
2007-05-30 17:39               ` Trond Myklebust
2007-05-23 19:15 ` [PATCH 3/4] AFS: Improve handling of a rejected writeback David Howells
2007-05-23 19:15 ` [PATCH 4/4] AFS: Implement shared-writable mmap David Howells

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=20070524154611.080b38ed.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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