archive mirror
 help / color / mirror / Atom feed
Subject: vfat dentry cache issues on 2.4.20
Date: Sat, 16 Aug 2003 18:16:14 -0600 (MDT)	[thread overview]
Message-ID: <> (raw)

I'm still running 2.4.20 (for an nForce chipset) so changes between then
and the current kernel may have fixed this.

I was getting errors from ls sometimes.  strace shows open() is failing
with "-1 ESTALE (Stale NFS file handle)" on the file ".".  After adding
some printk()s to fs/namei.c and fs/vfat/namei.c I think the ESTALE is
coming from the return_err: in fs/namei.c .

In particular dentry->d_op->d_revalidate(dentry,0) is returning 1 causing
d_invalidate(dentry) to be called but this may not clear the cache because
the only way I've found to get rid of the error message is to unmount and
re-mount the partition again.

Here is how I reproduce the error message:
( /dev/hdc2 on /data type vfat (rw,gid=102,umask=002) )

[frink@truth /data/foo]$\rm -rf *
[frink@truth /data/foo]$touch file    <--\__ this order is important
[frink@truth /data/foo]$mkdir dir     <--/
[frink@truth /data/foo]$cd dir
[frink@truth /data/foo/dir]$ls
[frink@truth /data/foo/dir]$mv ../file .
[frink@truth /data/foo/dir]$ls
/bin/ls: .: Stale NFS file handle
[frink@truth /data/foo/dir]$

A thread found on google seems to indicate that this problem has been seen
before (January 1999).  Has this been discussed recently?  Was it fixed and
is appearing again after some other change?  For that mater is it present in
the current development kernel?


Patches used:

[frink@truth /usr/src/linux/fs]$diff -u namei.c.orig namei.c
--- namei.c.orig        2002-11-28 16:53:15.000000000 -0700
+++ namei.c     2003-08-16 17:58:01.000000000 -0600
@@ -634,8 +634,17 @@
                dentry = nd->dentry;
                if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
+                       printk(KERN_DEBUG "vfat_NFS_error: (link_path_walk): ");
+                       if(name)
+                               printk("name: '%x' '%s'\n", name, name);
+                       else
+                               printk("name: NULL\n");
                        err = -ESTALE;
                        if (!dentry->d_op->d_revalidate(dentry, 0)) {
+                               printk(KERN_DEBUG "vfat_NFS_error: calling d_invalidate()\n");
@@ -648,6 +657,10 @@
+       if(err == -ESTALE) {
+               printk(KERN_DEBUG "vfat_NFS_error: link_path_walk() returning ESTALE\n");
+       }
        return err;

[frink@truth /usr/src/linux/fs]$diff -u vfat/namei.c.orig vfat/namei.c
--- vfat/namei.c.orig   2002-08-02 18:39:45.000000000 -0600
+++ vfat/namei.c        2003-08-12 20:27:55.000000000 -0600
@@ -75,12 +75,15 @@
 static int vfat_revalidate(struct dentry *dentry, int flags)
        PRINTK1(("vfat_revalidate: %s\n", dentry->;
+       printk(KERN_DEBUG "vfat_revalidate: %s\n", dentry->;
        if (dentry->d_time == dentry->d_parent->d_inode->i_version) {
+               printk(KERN_DEBUG "vfat_revalidate: return 1\n");
                return 1;
+       printk(KERN_DEBUG "vfat_revalidate: return ZERO!\n");
        return 0;

                 reply	other threads:[~2003-08-17  0:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: vfat dentry cache issues on 2.4.20' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).