From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Marcelo Tosatti <marcelo@conectiva.com.br>, hannal@us.ibm.com
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Linux FSdevel <linux-fsdevel@vger.kernel.org>
Subject: RE: [PATCH] path_lookup for 2.4.20-pre4 (ChangeSet@1.587.10.71)
Date: Tue, 8 Jul 2003 16:04:46 +0200 [thread overview]
Message-ID: <16138.53118.777914.828030@charged.uio.no> (raw)
This patch breaks NFS close-to-open cache consistency as it undoes
those changes that provide path revalidation for the case of
open(".").
The changelog entry doesn't even attempt to document this removal...
If people want to revert to the old behaviour, then there are ways of
doing this that will not affect NFS. Something like the appended patch
for instance...
Cheers,
Trond
diff -u --recursive --new-file linux-2.4.22-odirect/fs/namei.c linux-2.4.22-fix_cto/fs/namei.c
--- linux-2.4.22-odirect/fs/namei.c 2003-06-27 13:34:41.000000000 +0200
+++ linux-2.4.22-fix_cto/fs/namei.c 2003-07-08 15:51:08.000000000 +0200
@@ -563,7 +563,7 @@
while (*name=='/')
name++;
if (!*name)
- goto return_base;
+ goto return_reval;
inode = nd->dentry->d_inode;
if (current->link_count)
@@ -686,7 +686,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);
@@ -732,6 +732,24 @@
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.
+ * We may need to check the cached dentry for staleness.
+ */
+ if (nd->dentry && nd->dentry->d_sb &&
+ (nd->dentry->d_sb->s_type->fs_flags & FS_REVAL_DOT)) {
+ struct dentry *dentry = nd->dentry;
+ unlock_nd(nd);
+ dput(pinned.dentry);
+ mntput(pinned.mnt);
+ if (!dentry->d_op->d_revalidate(dentry, 0)) {
+ d_invalidate(dentry);
+ path_release(nd);
+ return -ESTALE;
+ }
+ return 0;
+ }
return_base:
unlock_nd(nd);
dput(pinned.dentry);
diff -u --recursive --new-file linux-2.4.22-odirect/fs/nfs/inode.c linux-2.4.22-fix_cto/fs/nfs/inode.c
--- linux-2.4.22-odirect/fs/nfs/inode.c 2002-08-15 03:05:32.000000000 +0200
+++ linux-2.4.22-fix_cto/fs/nfs/inode.c 2003-07-08 15:24:32.000000000 +0200
@@ -1125,7 +1125,7 @@
/*
* File system information
*/
-static DECLARE_FSTYPE(nfs_fs_type, "nfs", nfs_read_super, FS_ODD_RENAME);
+static DECLARE_FSTYPE(nfs_fs_type, "nfs", nfs_read_super, FS_ODD_RENAME|FS_REVAL_DOT);
extern int nfs_init_nfspagecache(void);
extern void nfs_destroy_nfspagecache(void);
diff -u --recursive --new-file linux-2.4.22-odirect/include/linux/fs.h linux-2.4.22-fix_cto/include/linux/fs.h
--- linux-2.4.22-odirect/include/linux/fs.h 2003-07-08 11:47:08.000000000 +0200
+++ linux-2.4.22-fix_cto/include/linux/fs.h 2003-07-08 15:47:06.000000000 +0200
@@ -92,6 +92,7 @@
#define FS_SINGLE 8 /* Filesystem that can have only one superblock */
#define FS_NOMOUNT 16 /* Never mount from userland */
#define FS_LITTER 32 /* Keeps the tree in dcache */
+#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
#define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon
* as nfs_rename() will be cleaned up
*/
next reply other threads:[~2003-07-08 13:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-08 14:04 Trond Myklebust [this message]
2003-07-08 14:16 ` Alan Cox
2003-07-08 15:00 ` [PATCH] Fastwalk: reduce cacheline bouncing of d_count (Changelog@1.1024.1.11) Trond Myklebust
2003-07-08 15:20 ` Alan Cox
2003-07-08 16:44 ` Herbert Poetzl
2003-07-08 16:53 ` Alan Cox
2003-07-08 17:06 ` Herbert Poetzl
2003-07-08 17:20 ` Matthew Wilcox
2003-07-08 17:42 ` Hanna Linder
2003-07-08 18:10 ` Trond Myklebust
2003-07-08 18:19 ` Hanna Linder
2003-07-08 19:26 ` Marcelo Tosatti
2003-07-08 19:24 ` Marcelo Tosatti
2003-07-08 16:20 ` [PATCH] path_lookup for 2.4.20-pre4 (ChangeSet@1.587.10.71) Jan Harkes
2003-07-08 16:41 ` [PATCH] Fastwalk: reduce cacheline bouncing of d_count (Changelog@1.1024.1.11) Trond Myklebust
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=16138.53118.777914.828030@charged.uio.no \
--to=trond.myklebust@fys.uio.no \
--cc=hannal@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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®