summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2018-05-11 11:49:32 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2018-07-20 09:56:13 +0200
commit0b17c28af1b8814505fd4eafd96e6e7e05bba01d (patch)
tree0fe76584baf4525ec73886444960eef66c56f9c5 /fs/overlayfs
parentb8a8824ca011050b590a6353067e722a24a591fb (diff)
downloadlinux-0b17c28af1b8814505fd4eafd96e6e7e05bba01d.tar.gz
linux-0b17c28af1b8814505fd4eafd96e6e7e05bba01d.tar.bz2
linux-0b17c28af1b8814505fd4eafd96e6e7e05bba01d.zip
ovl: Treat metacopy dentries as type OVL_PATH_MERGE
Right now OVL_PATH_MERGE is used only for merged directories. But conceptually, a metacopy dentry (backed by a lower data dentry) is a merged entity as well. So mark metacopy dentries as OVL_PATH_MERGE and ovl_rename() makes use of this property later to set redirect on a metacopy file. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 73939e08d8bf..61ace2de3019 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -134,7 +134,8 @@ enum ovl_path_type ovl_path_type(struct dentry *dentry)
*/
if (oe->numlower) {
type |= __OVL_PATH_ORIGIN;
- if (d_is_dir(dentry))
+ if (d_is_dir(dentry) ||
+ !ovl_has_upperdata(d_inode(dentry)))
type |= __OVL_PATH_MERGE;
}
} else {