mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Alexander Viro <viro@math.psu.edu>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.5.3-pre1] Fix NFS dentry lookup behaviour
Date: Fri, 18 Jan 2002 16:24:03 +0100	[thread overview]
Message-ID: <15432.15891.937634.771191@charged.uio.no> (raw)
In-Reply-To: <Pine.LNX.4.33.0201171414220.3114-100000@penguin.transmeta.com>
In-Reply-To: <15430.14576.445228.537714@charged.uio.no> <Pine.LNX.4.33.0201171414220.3114-100000@penguin.transmeta.com>

>>>>> " " == Linus Torvalds <torvalds@transmeta.com> writes:

     > What's wrong with using the existing "revalidate" approach? I
     > hate the notion of adding a special VFS layer call for
     > something like this.

The following patch to path_walk() is the alternative that I presented
to Linux Fsdevel last summer as part of the first draft patch. It uses
the standard d_revalidate() & friends.

As I said, the reaction at the time was not too positive, but perhaps
opinions have changed?

Cheers,
   Trond

diff -u --recursive --new-file linux-2.5.3-pre1/fs/namei.c linux-2.5.3-cto/fs/namei.c
--- linux-2.5.3-pre1/fs/namei.c	Mon Jan 14 18:41:57 2002
+++ linux-2.5.3-cto/fs/namei.c	Fri Jan 18 15:13:00 2002
@@ -457,7 +457,7 @@
 	while (*name=='/')
 		name++;
 	if (!*name)
-		goto return_base;
+		goto return_reval;
 
 	inode = nd->dentry->d_inode;
 	if (current->link_count)
@@ -576,7 +576,7 @@
 				inode = nd->dentry->d_inode;
 				/* fallthrough */
 			case 1:
-				goto return_base;
+				goto return_reval;
 		}
 		if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
 			err = nd->dentry->d_op->d_hash(nd->dentry, &this);
@@ -627,6 +627,19 @@
 			nd->last_type = LAST_DOT;
 		else if (this.len == 2 && this.name[1] == '.')
 			nd->last_type = LAST_DOTDOT;
+return_reval:
+		/*
+		 * We bypassed the ordinary revalidation routines.
+		 * Check the cached dentry for staleness.
+		 */
+		dentry = nd->dentry;
+		if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
+			err = -ESTALE;
+			if (!dentry->d_op->d_revalidate(dentry, 0)) {
+				d_invalidate(dentry);
+				break;
+			}
+		}
 return_base:
 		return 0;
 out_dput:

  parent reply	other threads:[~2002-01-18 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-17  2:37 Trond Myklebust
2002-01-17 22:15 ` Linus Torvalds
2002-01-17 22:24   ` Alexander Viro
2002-01-18 12:10   ` Trond Myklebust
2002-01-18 12:53     ` Alan Cox
2002-01-18 15:24 ` Trond Myklebust [this message]
2002-01-18 17:32   ` 2.4.18-pre4 nfs problem Stephan von Krawczynski

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=15432.15891.937634.771191@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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®