summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2020-03-17 15:04:22 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2020-03-17 15:04:22 +0100
commitf428884456192230ba1573e4028fb9282ffa2bb7 (patch)
treebf4c8ad98aaecb0ad80dc6d43f6a10ea005d67be /fs/overlayfs/namei.c
parentovl: separate detection of remote upper layer from stacked overlay (diff)
downloadlinux-f428884456192230ba1573e4028fb9282ffa2bb7.tar.xz
linux-f428884456192230ba1573e4028fb9282ffa2bb7.zip
ovl: decide if revalidate needed on a per-dentry basis
Allow completely skipping ->revalidate() on a per-dentry basis, in case the underlying layers used for a dentry do not themselves have ->revalidate(). E.g. negative overlay dentry has no underlying layers, hence revalidate is unnecessary. Or if lower layer is remote but overlay dentry is pure-upper, then can skip revalidate. The following places need to update whether the dentry needs revalidate or not: - fill-super (root dentry) - lookup - create - fh_to_dentry Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/namei.c')
-rw-r--r--fs/overlayfs/namei.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index a5b998a93a24..76e61cc27822 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1077,6 +1077,9 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
goto out_free_oe;
}
+ ovl_dentry_update_reval(dentry, upperdentry,
+ DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE);
+
revert_creds(old_cred);
if (origin_path) {
dput(origin_path->dentry);