summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/super.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
commitbccece1ead368149f90e05ad104dfbfda4422f5d (patch)
treed0d4524ba18318785ff354864f5a6aff753d59dd /fs/overlayfs/super.c
parentf428884456192230ba1573e4028fb9282ffa2bb7 (diff)
downloadlinux-bccece1ead368149f90e05ad104dfbfda4422f5d.tar.bz2
ovl: allow remote upper
No reason to prevent upper layer being a remote filesystem. Do the revalidation in that case, just as we already do for lower layers. This lets virtiofs be used as upper layer, which appears to be a real use case. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r--fs/overlayfs/super.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index d944ab46b69e..e8965fd1a608 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -135,9 +135,14 @@ static int ovl_dentry_revalidate_common(struct dentry *dentry,
unsigned int flags, bool weak)
{
struct ovl_entry *oe = dentry->d_fsdata;
+ struct dentry *upper;
unsigned int i;
int ret = 1;
+ upper = ovl_dentry_upper(dentry);
+ if (upper)
+ ret = ovl_revalidate_real(upper, flags, weak);
+
for (i = 0; ret > 0 && i < oe->numlower; i++) {
ret = ovl_revalidate_real(oe->lowerstack[i].dentry, flags,
weak);
@@ -747,8 +752,7 @@ static int ovl_mount_dir(const char *name, struct path *path)
ovl_unescape(tmp);
err = ovl_mount_dir_noesc(tmp, path);
- if (!err && (ovl_dentry_remote(path->dentry) ||
- path->dentry->d_flags & DCACHE_OP_REAL)) {
+ if (!err && path->dentry->d_flags & DCACHE_OP_REAL) {
pr_err("filesystem on '%s' not supported as upperdir\n",
tmp);
path_put_init(path);