Skip to content

Commit 7925dad

Browse files
author
Miklos Szeredi
committed
ovl: separate detection of remote upper layer from stacked overlay
Following patch will allow remote as upper layer, but not overlay stacked on upper layer. Separate the two concepts. This patch is doesn't change behavior. Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 3bb7df9 commit 7925dad

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

fs/overlayfs/namei.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,8 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
845845
if (err)
846846
goto out;
847847

848-
if (upperdentry && unlikely(ovl_dentry_remote(upperdentry))) {
848+
if (upperdentry && (upperdentry->d_flags & DCACHE_OP_REAL ||
849+
unlikely(ovl_dentry_remote(upperdentry)))) {
849850
dput(upperdentry);
850851
err = -EREMOTE;
851852
goto out;

fs/overlayfs/super.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,13 @@ static int ovl_mount_dir(const char *name, struct path *path)
752752
ovl_unescape(tmp);
753753
err = ovl_mount_dir_noesc(tmp, path);
754754

755-
if (!err)
756-
if (ovl_dentry_remote(path->dentry)) {
757-
pr_err("filesystem on '%s' not supported as upperdir\n",
758-
tmp);
759-
path_put_init(path);
760-
err = -EINVAL;
761-
}
755+
if (!err && (ovl_dentry_remote(path->dentry) ||
756+
path->dentry->d_flags & DCACHE_OP_REAL)) {
757+
pr_err("filesystem on '%s' not supported as upperdir\n",
758+
tmp);
759+
path_put_init(path);
760+
err = -EINVAL;
761+
}
762762
kfree(tmp);
763763
}
764764
return err;

fs/overlayfs/util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ struct ovl_entry *ovl_alloc_entry(unsigned int numlower)
9393
bool ovl_dentry_remote(struct dentry *dentry)
9494
{
9595
return dentry->d_flags &
96-
(DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE |
97-
DCACHE_OP_REAL);
96+
(DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE);
9897
}
9998

10099
bool ovl_dentry_weird(struct dentry *dentry)

0 commit comments

Comments
 (0)