Bug 15993 - Invalid stat (ls -l) information on NFS mounted directories
Summary: Invalid stat (ls -l) information on NFS mounted directories
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel   
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Michael K. Johnson
QA Contact:
URL:
Whiteboard: Winston gold
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-11 14:12 UTC by Thor Nolen
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-19 14:16:57 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Thor Nolen 2000-08-11 14:12:13 UTC
fh_verify (in fs/nfsd/nfsfh.c) uses dentry->inode and its contents
(eg., i_size) without ever calling the fileysstem revalidate op.
The result is bad (out-of-date) stat information).

 Puting the following code into fh_verify avoids this:

      inode = dentry->d_inode;

      /* Before using this inode, it must be revalidated with the
filesystem. */
      if (inode->i_op && inode->i_op->revalidate)
      {
        error = inode->i_op->revalidate(dentry);
        if (error)
          goto out;
     
}

Comment 1 Glen Foster 2000-08-13 19:51:02 UTC
Changing product to Red Hat Linux beta

Comment 2 Glen Foster 2000-08-13 19:51:41 UTC
This defect is considered MUST-FIX for Winston Gold-release

Comment 3 Phil Knirsch 2000-08-18 08:43:55 UTC
I might be wrong, but isn't that a bug that has been hanging around for ages? If
i remember correctly the effect of this bug is that sometimes after saving a
file on a server you have to wait a couple of seconds before these updates are
reflected on the client. Here a small example:
You are working on a package, edit a file directly on a server and recompile it
over NFS. If you start the make very quickly after the save often the saved file
was not recompiled!
So this really should be done. I'm looking into the fix if it is doing the right
thing(tm) and doesn't break anything else.

Comment 4 Phil Knirsch 2000-08-18 10:35:44 UTC
Hmmm. After testing it it doesn't show up that way anymore. It still might be a
good idea to include this patch in the kernel as this would ensure the
revalidation of the inode. It is being used at various other places in the
filesystem tree, so i guess we can safely assume that it will work :)

Can someone put this patch into the kernel source:

--- linux/fs/nfsd/nfsfh.c.orig  Fri Aug 18 12:32:30 2000
+++ linux/fs/nfsd/nfsfh.c       Fri Aug 18 12:32:47 2000
@@ -1195,6 +1195,16 @@
 check_type:
        dentry = fhp->fh_dentry;
        inode = dentry->d_inode;
+
+       /* Before using this inode, it must be revalidated with the
+          filesystem.
+        */
+       if (inode->i_op && inode->i_op->revalidate) {
+               error = inode->i_op->revalidate(dentry);
+               if (error)
+                       goto out;
+       }
+
        error = nfserr_stale;
        /* On a heavily loaded SMP machine, more than one identical
           requests may run at the same time on different processors.



Comment 5 Preston Brown 2000-08-19 14:16:53 UTC
Michael, please take a look at this one.  Doug is ignoring us.

Comment 6 Michael K. Johnson 2000-08-21 20:42:00 UTC
We can't evaluate this change in time, I'm deferring it.

Comment 7 Michael K. Johnson 2000-08-31 22:09:30 UTC
Alan, could you please comment on this one?

Comment 8 Alan Cox 2000-12-28 16:55:03 UTC
NFS is not cache coherent. So it was never truely a bug. Its just an
undesirable. 2.2.18 NFS changes should have killed this one off



Note You need to log in before you can comment on or make changes to this bug.