summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/inode.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-10-15 18:00:20 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2018-01-24 11:25:58 +0100
commitaa3ff3c152ff94ef045ed802db7535167f8a21ab (patch)
treebdeb25cc1784bf8bf2862d654b8a9ea5b0134b33 /fs/overlayfs/inode.c
parent829c28be9bb9a05aa7eeb8a68a4536cca2d3d694 (diff)
downloadblackbird-op-linux-aa3ff3c152ff94ef045ed802db7535167f8a21ab.tar.gz
blackbird-op-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.c4
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))
OpenPOWER on IntegriCloud