Commit bccece1e authored by Miklos Szeredi's avatar Miklos Szeredi

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: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent f4288844
...@@ -845,8 +845,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, ...@@ -845,8 +845,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
if (err) if (err)
goto out; goto out;
if (upperdentry && (upperdentry->d_flags & DCACHE_OP_REAL || if (upperdentry && upperdentry->d_flags & DCACHE_OP_REAL) {
unlikely(ovl_dentry_remote(upperdentry)))) {
dput(upperdentry); dput(upperdentry);
err = -EREMOTE; err = -EREMOTE;
goto out; goto out;
......
...@@ -135,9 +135,14 @@ static int ovl_dentry_revalidate_common(struct dentry *dentry, ...@@ -135,9 +135,14 @@ static int ovl_dentry_revalidate_common(struct dentry *dentry,
unsigned int flags, bool weak) unsigned int flags, bool weak)
{ {
struct ovl_entry *oe = dentry->d_fsdata; struct ovl_entry *oe = dentry->d_fsdata;
struct dentry *upper;
unsigned int i; unsigned int i;
int ret = 1; 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++) { for (i = 0; ret > 0 && i < oe->numlower; i++) {
ret = ovl_revalidate_real(oe->lowerstack[i].dentry, flags, ret = ovl_revalidate_real(oe->lowerstack[i].dentry, flags,
weak); weak);
...@@ -747,8 +752,7 @@ static int ovl_mount_dir(const char *name, struct path *path) ...@@ -747,8 +752,7 @@ static int ovl_mount_dir(const char *name, struct path *path)
ovl_unescape(tmp); ovl_unescape(tmp);
err = ovl_mount_dir_noesc(tmp, path); err = ovl_mount_dir_noesc(tmp, path);
if (!err && (ovl_dentry_remote(path->dentry) || if (!err && path->dentry->d_flags & DCACHE_OP_REAL) {
path->dentry->d_flags & DCACHE_OP_REAL)) {
pr_err("filesystem on '%s' not supported as upperdir\n", pr_err("filesystem on '%s' not supported as upperdir\n",
tmp); tmp);
path_put_init(path); path_put_init(path);
......
...@@ -102,6 +102,8 @@ void ovl_dentry_update_reval(struct dentry *dentry, struct dentry *upperdentry, ...@@ -102,6 +102,8 @@ void ovl_dentry_update_reval(struct dentry *dentry, struct dentry *upperdentry,
struct ovl_entry *oe = OVL_E(dentry); struct ovl_entry *oe = OVL_E(dentry);
unsigned int i, flags = 0; unsigned int i, flags = 0;
if (upperdentry)
flags |= upperdentry->d_flags;
for (i = 0; i < oe->numlower; i++) for (i = 0; i < oe->numlower; i++)
flags |= oe->lowerstack[i].dentry->d_flags; flags |= oe->lowerstack[i].dentry->d_flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment