diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2018-05-11 11:49:32 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-07-20 09:56:14 +0200 |
commit | 60124877b9ec4fa5a34ddeeedba473820888d4b2 (patch) | |
tree | 8d0c99d3c5e5cb72065915960b0d7cbf51d0078f /fs/overlayfs/dir.c | |
parent | a00c2d59e914b8ec46f1637e2e283aa35583c455 (diff) | |
download | linux-60124877b9ec4fa5a34ddeeedba473820888d4b2.tar.bz2 |
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>
Diffstat (limited to 'fs/overlayfs/dir.c')
0 files changed, 0 insertions, 0 deletions