diff options
author | Amir Goldstein <amir73il@gmail.com> | 2018-01-19 22:33:44 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-01-24 13:26:02 +0300 |
commit | f941866fc4a8ad0d0b861cc2dbffa06a9f5e8963 (patch) | |
tree | 2600400b0ce59c94c28132e167441f5dc6486363 /fs/overlayfs/namei.c | |
parent | 03e1c584ffbcb4ce05c3c61b76aceab4c12d6b68 (diff) | |
download | linux-f941866fc4a8ad0d0b861cc2dbffa06a9f5e8963.tar.xz |
ovl: decode lower non-dir file handles
Decoding a lower non-dir file handle is done by decoding the lower dentry
from underlying lower fs, finding or allocating an overlay inode that is
hashed by the real lower inode and instantiating an overlay dentry with
that inode.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/namei.c')
-rw-r--r-- | fs/overlayfs/namei.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index a35c5eaa2c01..741a42d974a3 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -310,9 +310,8 @@ static int ovl_lookup_layer(struct dentry *base, struct ovl_lookup_data *d, } -static int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, - struct dentry *upperdentry, - struct ovl_path **stackp) +int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, + struct dentry *upperdentry, struct ovl_path **stackp) { struct dentry *origin = NULL; int i; @@ -328,7 +327,7 @@ static int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, else if (IS_ERR(origin)) return PTR_ERR(origin); - if (!ovl_is_whiteout(upperdentry) && + if (upperdentry && !ovl_is_whiteout(upperdentry) && ((d_inode(origin)->i_mode ^ d_inode(upperdentry)->i_mode) & S_IFMT)) goto invalid; |