Skip to content

Commit 40fc810

Browse files
committed
afs: Fix afs_d_validate() to set the right directory version
If a dentry's version is somewhere between invalid_before and the current directory version, we should be setting it forward to the current version, not backwards to the invalid_before version. Note that we're only doing this at all because dentry::d_fsdata isn't large enough on a 32-bit system. Fix this by using a separate variable for invalid_before so that we don't accidentally clobber the current dir version. Fixes: a4ff740 ("afs: Keep track of invalid-before version for dentry coherency") Signed-off-by: David Howells <[email protected]>
1 parent 2105c28 commit 40fc810

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/afs/dir.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
10321032
struct dentry *parent;
10331033
struct inode *inode;
10341034
struct key *key;
1035-
afs_dataversion_t dir_version;
1035+
afs_dataversion_t dir_version, invalid_before;
10361036
long de_version;
10371037
int ret;
10381038

@@ -1084,8 +1084,8 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
10841084
if (de_version == (long)dir_version)
10851085
goto out_valid_noupdate;
10861086

1087-
dir_version = dir->invalid_before;
1088-
if (de_version - (long)dir_version >= 0)
1087+
invalid_before = dir->invalid_before;
1088+
if (de_version - (long)invalid_before >= 0)
10891089
goto out_valid;
10901090

10911091
_debug("dir modified");

0 commit comments

Comments
 (0)