diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-06-25 15:37:17 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-11-09 10:23:26 +0100 |
commit | b79e05aaa166755fafbf02db275175edb5175df8 (patch) | |
tree | aaa5fcc30c2ffe7c22df0074900846917332c08b /fs/overlayfs/super.c | |
parent | ovl: lockdep annotate of nested OVL_I(inode)->lock (diff) | |
download | linux-b79e05aaa166755fafbf02db275175edb5175df8.tar.xz linux-b79e05aaa166755fafbf02db275175edb5175df8.zip |
ovl: no direct iteration for dir with origin xattr
If a non-merge dir in an overlay mount has an overlay.origin xattr, it
means it was once an upper merge dir, which may contain whiteouts and
then the lower dir was removed under it.
Do not iterate real dir directly in this case to avoid exposing whiteouts.
[SzM] Set OVL_WHITEOUT for all merge directories as well.
[amir] A directory that was just copied up does not have the OVL_WHITEOUTS
flag. We need to set it to fix merge dir iteration.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r-- | fs/overlayfs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index f5738e96a052..8d82a1cb655f 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1141,6 +1141,8 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) root_dentry->d_fsdata = oe; + /* Root is always merge -> can have whiteouts */ + ovl_set_flag(OVL_WHITEOUTS, d_inode(root_dentry)); ovl_inode_init(d_inode(root_dentry), upperpath.dentry, ovl_dentry_lower(root_dentry)); |