All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Nikolai Joukov <kolya@cs.sunysb.edu>
Cc: "John T. Kohl" <jtk@us.ibm.com>,
	Trond Myklebust <trondmy@trondhjem.org>,
	dhowells@redhat.com, nfsv4@linux-nfs.org,
	Charles Wright <cwright@cs.sunysb.edu>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] Support for stackable file systems on top of nfs
Date: Mon, 14 Nov 2005 16:02:13 +0000	[thread overview]
Message-ID: <17963.1131984133@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.53.0511131919530.23544@compserv1>

Nikolai Joukov <kolya@cs.sunysb.edu> wrote:

> int stackable_readpage(file_t *file, page_t *page)
> {
>  ...
>  page->mapping = lower_inode->i_mapping;
>  err = lower_inode->i_mapping->a_ops->readpage(lower_file, page);
>  page->mapping = inode->i_mapping;
>  ...
> }

This is a really bad idea for a number of reasons:

 (1) page->mapping isn't the only metadata in the page.

 (2) The lower_inode may interpret a hold as a block of zeros rather than
     bouncing the request back to the higher inode with ENODATA or something.

 (3) The lower_inode readpage() may not be complete at the time you switch the
     mapping pointer back. Obviously the page will be locked until at such
     time as completion or an error occurs.

 (4) The lower_inode readpage() may complete before it returns, in which case
     the VM may go and do something unspeakable to that page whilst it's still
     got the wrong mapping attached.

 (5) The lower_inode may have attached its own metadata to page->private, and
     this may refer back to this page, and may subsequently trip an assertion
     because the page's mapping pointer has been corrupted.

David

  reply	other threads:[~2005-11-14 16:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-14  0:44 [RFC] Support for stackable file systems on top of nfs Nikolai Joukov
2005-11-14 16:02 ` David Howells [this message]
2005-11-14 20:48   ` Erez Zadok
2005-11-14 21:13     ` John T. Kohl
2005-11-14 21:32       ` Jamie Lokier
2005-11-14 16:11 ` John T. Kohl
  -- strict thread matches above, loose matches on Subject: below --
2005-11-10 17:32 Dave Kleikamp
2005-11-10 20:07 ` Christoph Hellwig
2005-11-10 21:35   ` John T. Kohl
2005-11-10 21:40     ` Shaya Potter
2005-11-10 21:57       ` John T. Kohl
2005-11-10 21:50     ` Christoph Hellwig
2005-11-11  2:31     ` Trond Myklebust
2005-11-11  4:04       ` Trond Myklebust
2005-11-11 13:45         ` John T. Kohl
2005-11-11 15:27           ` Charles P. Wright
2005-11-11 17:38             ` John T. Kohl
2005-11-14 15:56       ` David Howells
2005-11-10 21:24 ` Trond Myklebust
2005-11-10 21:36   ` Shaya Potter
2005-11-10 22:18     ` Trond Myklebust
2005-11-10 22:27       ` Shaya Potter
2005-11-10 22:40         ` Trond Myklebust
2005-11-11  0:12           ` Bryan Henderson
2005-11-11  1:30             ` Brad Boyer
2005-11-11  2:06             ` Trond Myklebust
2005-11-11 18:18               ` Bryan Henderson
2005-11-11 19:22                 ` Trond Myklebust
2005-11-11 21:57                   ` Bryan Henderson
2005-11-11 22:41                     ` Trond Myklebust
2005-11-14 19:02                       ` Bryan Henderson
2005-11-11 16:40             ` Nikita Danilov
2005-11-11 18:45               ` Bryan Henderson
2005-11-11 19:31                 ` Nikita Danilov
2005-11-11 19:42                   ` Trond Myklebust
2005-11-11 23:13                   ` Bryan Henderson

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=17963.1131984133@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=cwright@cs.sunysb.edu \
    --cc=jtk@us.ibm.com \
    --cc=kolya@cs.sunysb.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    --cc=trondmy@trondhjem.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.