]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
afs: Fix afs_lookup() to not clobber the version on a new dentry
authorDavid Howells <dhowells@redhat.com>
Tue, 14 Jan 2020 16:16:54 +0000 (16:16 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Jan 2020 17:40:06 +0000 (09:40 -0800)
Fix afs_lookup() to not clobber the version set on a new dentry by
afs_do_lookup() - especially as it's using the wrong version of the
version (we need to use the one given to us by whatever op the dir
contents correspond to rather than what's in the afs_vnode).

Fixes: 9dd0b82ef530 ("afs: Fix missing dentry data version updating")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/dir.c

index 813db17084943d212d18f8dd058e41873726ba8b..5c794f4b051afcc953f97ceff3b562402a31b4e0 100644 (file)
@@ -952,12 +952,8 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
        afs_stat_v(dvnode, n_lookup);
        inode = afs_do_lookup(dir, dentry, key);
        key_put(key);
-       if (inode == ERR_PTR(-ENOENT)) {
+       if (inode == ERR_PTR(-ENOENT))
                inode = afs_try_auto_mntpt(dentry, dir);
-       } else {
-               dentry->d_fsdata =
-                       (void *)(unsigned long)dvnode->status.data_version;
-       }
 
        if (!IS_ERR_OR_NULL(inode))
                fid = AFS_FS_I(inode)->fid;