linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Harkes <jaharkes@cs.cmu.edu>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2.4.19pre8][RFC] remove-NFS-close-to-open from VFS (was Re: [PATCHSET] 2.4.19-pre8-jp12)
Date: Fri, 18 Oct 2002 14:23:52 -0400	[thread overview]
Message-ID: <20021018182352.GA13649@ravel.coda.cs.cmu.edu> (raw)
In-Reply-To: <15792.18388.849961.869579@charged.uio.no>

On Fri, Oct 18, 2002 at 07:41:40PM +0200, Trond Myklebust wrote:
> >>>>> " " == Jan Harkes <jaharkes@cs.cmu.edu> writes:
> 
>      > So, we're not really revalidating the dcache entry at
>      > all. Maybe the code really wants to revalidate the inode.
> 
> That is indeed the correct thing to do here according to POSIX, and is
> really all I want to do for NFS too.  For that reason, I originally
> proposed to use i_op->revalidate(), but that was vetoed as you may
> recall.

It was? I really hope I wasn't one of the veto-ers because looking at
this problem it does seem like the correct thing to do as we're not
trying to see whether the path is correct, but only the object.

Ok, it will cost Coda a whole upcall/context switch, but as it is '.'
we're talking about it should already be locally cached.

btw. you can easily drop the lookup in nfs_lookup_revalidate.
It is a bug for this case, and not necessary in all other places
d_revalidate is called as the VFS already uses real_lookup in those
cases.

Jan


Haven't tried to compile it yet, but I guess it would look something
like this?

diff -urN linux-2.4.19/fs/namei.c linux-2.4.19-revalidate/fs/namei.c
--- linux-2.4.19/fs/namei.c	2002-08-28 01:07:35.000000000 -0400
+++ linux-2.4.19-revalidate/fs/namei.c	2002-10-18 14:21:13.000000000 -0400
@@ -633,9 +633,12 @@
 		 * Check the cached dentry for staleness.
 		 */
 		dentry = nd->dentry;
-		if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
+		if (dentry) {
 			err = -ESTALE;
-			if (!dentry->d_op->d_revalidate(dentry, 0)) {
+			if (!dentry->d_inode || is_bad_inode(dentry->d_inode) ||
+			    (dentry->d_inode->i_op && 
+			     dentry->d_inode->i_op->revalidate &&
+			    !dentry->d_inode->i_op->revalidate(dentry))) {
 				d_invalidate(dentry);
 				break;
 			}

  reply	other threads:[~2002-10-18 18:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200205162142.AWF00051@netmail.netcologne.de>
     [not found] ` <E178TUb-0005Bh-00@the-village.bc.nu>
     [not found]   ` <20020517034357.GA18449@ravel.coda.cs.cmu.edu>
     [not found]     ` <Pine.LNX.4.44.0205161105520.5254-100000@alumno.inacap.cl>
2002-10-17 20:38       ` [PATCH 2.4.19pre8][RFC] remove-NFS-close-to-open from VFS (was Re: [PATCHSET] 2.4.19-pre8-jp12) Jan Harkes
2002-10-17 21:48         ` Trond Myklebust
2002-10-17 22:16           ` Jan Harkes
2002-10-17 23:57             ` Trond Myklebust
2002-10-18 16:49               ` Jan Harkes
2002-10-18 17:03                 ` Trond Myklebust
2002-10-18 17:12                   ` Jan Harkes
2002-10-18 17:41                     ` Trond Myklebust
2002-10-18 18:23                       ` Jan Harkes [this message]
2002-10-18 19:23                         ` Trond Myklebust
2002-10-21 17:07                           ` Jan Harkes

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=20021018182352.GA13649@ravel.coda.cs.cmu.edu \
    --to=jaharkes@cs.cmu.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /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;
as well as URLs for NNTP newsgroup(s).