diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-10-15 17:00:20 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-01-24 11:25:58 +0100 |
commit | aa3ff3c152ff94ef045ed802db7535167f8a21ab (patch) | |
tree | bdeb25cc1784bf8bf2862d654b8a9ea5b0134b33 /fs/overlayfs/inode.c | |
parent | ovl: use d_splice_alias() in place of d_add() in lookup (diff) | |
download | linux-aa3ff3c152ff94ef045ed802db7535167f8a21ab.tar.xz linux-aa3ff3c152ff94ef045ed802db7535167f8a21ab.zip |
ovl: copy up of disconnected dentries
With NFS export, some operations on decoded file handles (e.g. open,
link, setattr, xattr_set) may call copy up with a disconnected non-dir.
In this case, we will copy up lower inode to index dir without
linking it to upper dir.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/inode.c')
-rw-r--r-- | fs/overlayfs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index f8f7facb7331..bfd7c766b5cd 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -351,8 +351,10 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type) static bool ovl_open_need_copy_up(struct dentry *dentry, int flags) { + /* Copy up of disconnected dentry does not set upper alias */ if (ovl_dentry_upper(dentry) && - ovl_dentry_has_upper_alias(dentry)) + (ovl_dentry_has_upper_alias(dentry) || + (dentry->d_flags & DCACHE_DISCONNECTED))) return false; if (special_file(d_inode(dentry)->i_mode)) |