diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 0ed7c40..7b2d95d 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -251,11 +251,15 @@ ssize_t ovl_getxattr(struct dentry *dentry, struct inode *inode, const char *name, void *value, size_t size) { struct path realpath; - enum ovl_path_type type = ovl_path_real(dentry, &realpath); - - if (ovl_need_xattr_filter(dentry, type) && ovl_is_private_xattr(name)) - return -ENODATA; - + struct ovl_entry *oe = dentry->d_fsdata; + if (oe->__upperdentry) { + ovl_path_upper(dentry, &realpath); + if (S_ISDIR(inode) && (oe->numlower || oe->opaque) && + ovl_is_private_xattr(name)) + return -ENODATA; + } else { + ovl_path_lower(dentry, &realpath); + } return vfs_getxattr(realpath.dentry, name, value, size); }