]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - fs/overlayfs/copy_up.c
xattr: Add __vfs_{get,set,remove}xattr helpers
[mirror_ubuntu-focal-kernel.git] / fs / overlayfs / copy_up.c
index 54e5d6681786780812c9a5adddc27dd782b40bbb..807951cb438c47b06d437c5b8262d385f36cd6bd 100644 (file)
@@ -58,8 +58,8 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
        char *buf, *name, *value = NULL;
        int uninitialized_var(error);
 
-       if (!old->d_inode->i_op->getxattr ||
-           !new->d_inode->i_op->getxattr)
+       if (!(old->d_inode->i_opflags & IOP_XATTR) ||
+           !(new->d_inode->i_opflags & IOP_XATTR))
                return 0;
 
        list_size = vfs_listxattr(old, NULL, 0);
@@ -80,6 +80,8 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
        }
 
        for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
+               if (ovl_is_private_xattr(name))
+                       continue;
 retry:
                size = vfs_getxattr(old, name, value, value_size);
                if (size == -ERANGE)