ovl: no direct iteration for dir with origin xattr
authorAmir Goldstein <amir73il@gmail.com>
Sun, 25 Jun 2017 13:37:17 +0000 (16:37 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 9 Nov 2017 09:23:26 +0000 (10:23 +0100)
commitb79e05aaa166755fafbf02db275175edb5175df8
treeaaa5fcc30c2ffe7c22df0074900846917332c08b
parent4eae06de482bf370144704e31f65cd6dfbcebe94
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>
fs/overlayfs/copy_up.c
fs/overlayfs/inode.c
fs/overlayfs/overlayfs.h
fs/overlayfs/readdir.c
fs/overlayfs/super.c
fs/overlayfs/util.c