android_kernel_motorola_sm6225/fs/overlayfs
Vivek Goyal 60124877b9 ovl: Do not set dentry type ORIGIN for broken hardlinks
If a dentry has copy up origin, we set flag OVL_PATH_ORIGIN.  So far this
decision was easy that we had to check only for oe->numlower and if it is
non-zero, we knew there is copy up origin.  (For non-dir we installed
origin dentry in lowerstack[0]).

But we don't create ORGIN xattr for broken hardlinks (index=off).  And with
metacopy feature it is possible that we will install lowerstack[0] but
ORIGIN xattr is not there.  It is data dentry of upper metacopy dentry
which has been found using regular name based lookup or using REDIRECT.  So
with addition of this new case, just presence of oe->numlower is not
sufficient to guarantee that ORIGIN xattr is present.

So to differentiate between two cases, look at OVL_CONST_INO flag.  If this
flag is set and upperdentry is there, that means it can be marked as type
ORIGIN.  OVL_CONST_INO is not set if lower hardlink is broken or will be
broken over copy up.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-07-20 09:56:14 +02:00
..
copy_up.c ovl: Copy up meta inode data from lowest data inode 2018-07-20 09:56:09 +02:00
dir.c ovl: copy up times 2018-07-18 15:44:40 +02:00
export.c ovl: Modify ovl_lookup() and friends to lookup metacopy dentry 2018-07-20 09:56:09 +02:00
file.c ovl: Open file with data except for the case of fsync 2018-07-20 09:56:12 +02:00
inode.c ovl: Add an inode flag OVL_CONST_INO 2018-07-20 09:56:14 +02:00
Kconfig ovl: Provide a mount option metacopy=on/off for metadata copyup 2018-07-20 09:56:06 +02:00
Makefile ovl: stack file ops 2018-07-18 15:44:41 +02:00
namei.c ovl: Check redirects for metacopy files 2018-07-20 09:56:13 +02:00
overlayfs.h ovl: Add an inode flag OVL_CONST_INO 2018-07-20 09:56:14 +02:00
ovl_entry.h ovl: Store lower data inode in ovl_inode 2018-07-20 09:56:11 +02:00
readdir.c ovl: fix wrong use of impure dir cache in ovl_iterate() 2018-07-17 16:04:34 +02:00
super.c ovl: Do not expose metacopy only dentry from d_real() 2018-07-20 09:56:12 +02:00
util.c ovl: Do not set dentry type ORIGIN for broken hardlinks 2018-07-20 09:56:14 +02:00