From: Valerie Aurora <vaurora@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
linux-fsdevel@vger.kernel.org,
Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: Re: NFS hard read-only mount option - again
Date: Thu, 6 May 2010 11:01:32 -0400 [thread overview]
Message-ID: <20100506150132.GB20761@shell> (raw)
In-Reply-To: <20100505092230.574c2de2@corrin.poochiereds.net>
On Wed, May 05, 2010 at 09:22:30AM +0200, Jeff Layton wrote:
> On Tue, 4 May 2010 18:51:56 -0400
> Valerie Aurora <vaurora@redhat.com> wrote:
> >
> > This is definitely going in the right direction, thank you. Mainly
> > I'm just really ignorant of actual NFS implementation. :)
> >
> > Let's focus on detecting a write to a file or directory the client has
> > read and still has in cache. This would be the case of an NFS dentry
> > in cache on the client that is written on the server. So what is the
> > actual code path if the client has an NFS dentry in cache and it is
> > altered or goes away on the client? Can we hook in there and disable
> > the union mount? Is this a totally dumb idea?
> >
> > -VAL
>
> Well...we typically can tell if an inode changed -- see
> nfs_update_inode for most of that logic. Note that the methods we use
> there are not perfect -- NFSv2/3 rely heavily on timestamps and if the
> server is using a filesystem with coarse-grained timestamps (e.g. ext3)
> then it's possible for things to change and the client won't notice
> (whee!)
>
> Dentries don't really change like inodes do, but we do generally check
> whether they are correct before trusting them. That's done via the
> d_revalidate methods for NFS. Mostly that involves checking whether the
> directory that contains the it has changed since the dentry was spawned.
>
> That's probably where you'll want to place your hooks, but I wonder
> whether it would be better to do that at a higher level -- in the
> generic VFS. Whenever a d_revalidate op returns false, then you know
> that something has happened.
My gut feeling is that you are right and the VFS call of the
d_revalidate op is the right place to check this. My guess is that
->d_revalidate() should never fail in the lower/read-only layers of a
union mount, no matter what the file system is. Can you think of a
d_revalidate implementation that would fail for a reason other than a
write on the server?
Thanks,
-VAL
prev parent reply other threads:[~2010-05-06 15:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-26 23:58 NFS hard read-only mount option - again Valerie Aurora
2010-04-27 11:51 ` Jeff Layton
2010-04-28 20:07 ` Valerie Aurora
2010-04-28 20:34 ` Jeff Layton
2010-04-28 20:56 ` J. Bruce Fields
2010-05-04 22:51 ` Valerie Aurora
2010-05-05 7:22 ` Jeff Layton
2010-05-06 15:01 ` Valerie Aurora [this message]
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=20100506150132.GB20761@shell \
--to=vaurora@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@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 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.