* In the case it has, we assume that the dentries are untrustworthy
* and may need to be looked up again.
*/
-static inline int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
+static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
{
if (IS_ROOT(dentry))
return 1;
dentry->d_fsdata = (void *)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);
+}
+
/*
* Whenever an NFS operation succeeds, we know that the dentry
* is valid, so we update the revalidation timestamp.
goto out_bad;
nfs_renew_times(dentry);
- nfs_set_verifier(dentry, verifier);
+ nfs_refresh_verifier(dentry, verifier);
out_valid:
unlock_kernel();
dput(parent);
verifier = nfs_save_change_attribute(dir);
ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
if (!ret)
- nfs_set_verifier(dentry, verifier);
+ nfs_refresh_verifier(dentry, verifier);
unlock_kernel();
out:
dput(parent);
dentry = alias;
}
-out_renew:
nfs_renew_times(dentry);
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
return dentry;
+out_renew:
+ nfs_renew_times(dentry);
+ nfs_refresh_verifier(dentry, nfs_save_change_attribute(dir));
+ return dentry;
}
/*
if (!error) {
d_move(old_dentry, new_dentry);
nfs_renew_times(new_dentry);
- nfs_set_verifier(new_dentry, nfs_save_change_attribute(new_dir));
+ nfs_refresh_verifier(new_dentry, nfs_save_change_attribute(new_dir));
}
/* new dentry created? */