Commit e62c2bba authored by Trond Myklebust's avatar Trond Myklebust

NFS: Fix a jiffie wraparound issue

dentry verifiers are always set to the parent directory's
cache_change_attribute. There is no reason to be testing for anything other
than equality when we're trying to find out if the dentry has been checked
since the last time the directory was modified.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 38cb162b
...@@ -650,12 +650,17 @@ int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) ...@@ -650,12 +650,17 @@ int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
*/ */
static int nfs_check_verifier(struct inode *dir, struct dentry *dentry) static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
{ {
unsigned long verf;
if (IS_ROOT(dentry)) if (IS_ROOT(dentry))
return 1; return 1;
verf = (unsigned long)dentry->d_fsdata;
if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0 if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0
|| nfs_attribute_timeout(dir)) || nfs_attribute_timeout(dir)
|| nfs_caches_unstable(dir)
|| verf != NFS_I(dir)->cache_change_attribute)
return 0; return 0;
return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); return 1;
} }
static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
...@@ -665,7 +670,6 @@ static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) ...@@ -665,7 +670,6 @@ static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf) static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf)
{ {
if (time_after(verf, (unsigned long)dentry->d_fsdata))
nfs_set_verifier(dentry, verf); nfs_set_verifier(dentry, verf);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment