From f428884456192230ba1573e4028fb9282ffa2bb7 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 17 Mar 2020 15:04:22 +0100 Subject: 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 --- fs/overlayfs/dir.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/overlayfs/dir.c') diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 8e57d5372b8f..b3471ef51440 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -243,6 +243,9 @@ static int ovl_instantiate(struct dentry *dentry, struct inode *inode, ovl_dir_modified(dentry->d_parent, false); ovl_dentry_set_upper_alias(dentry); + ovl_dentry_update_reval(dentry, newdentry, + DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE); + if (!hardlink) { /* * ovl_obtain_alias() can be called after ovl_create_real() -- cgit v1.2.3