NFS: Fix a resolution problem with nfs_inode->cache_change_attribute
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 14 Oct 2008 23:24:50 +0000 (19:24 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 14 Oct 2008 23:24:50 +0000 (19:24 -0400)
The cache_change_attribute is used to decide whether or not a directory has
changed, in which case we may need to look it up again. Again, the use of
'jiffies' leads to an issue of resolution.

Once again, the fix is to change nfs_inode->cache_change_attribute, and
just make it a simple counter.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c
fs/nfs/inode.c

index 4807074ada8c7564c7020f2a091ec5ca8e9f4614..2ab70d46ecbc7ac43a0585183adcfe248ac5b127 100644 (file)
@@ -661,7 +661,7 @@ static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
  */
 void nfs_force_lookup_revalidate(struct inode *dir)
 {
-       NFS_I(dir)->cache_change_attribute = jiffies;
+       NFS_I(dir)->cache_change_attribute++;
 }
 
 /*
index 116a3bd2bc9b7e08428bddb5ad1da62ebf83b54b..b9195c02a8637c6bf14bc852ae8e8a924605a383 100644 (file)
@@ -306,7 +306,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
 
                nfsi->read_cache_jiffies = fattr->time_start;
                nfsi->attr_gencount = fattr->gencount;
-               nfsi->cache_change_attribute = now;
                inode->i_atime = fattr->atime;
                inode->i_mtime = fattr->mtime;
                inode->i_ctime = fattr->ctime;