ovl: fix workdir creation
[cascardo/linux.git] / fs / overlayfs / super.c
index cba2c9f..e2a94a2 100644 (file)
@@ -835,11 +835,11 @@ retry:
                        goto out_dput;
 
                err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
-               if (err && err != -ENODATA)
+               if (err && err != -ENODATA && err != -EOPNOTSUPP)
                        goto out_dput;
 
                err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
-               if (err && err != -ENODATA)
+               if (err && err != -ENODATA && err != -EOPNOTSUPP)
                        goto out_dput;
 
                /* Clear any inherited mode bits */
@@ -986,6 +986,14 @@ static unsigned int ovl_split_lowerdirs(char *str)
        return ctr;
 }
 
+static int __maybe_unused
+ovl_posix_acl_xattr_get(const struct xattr_handler *handler,
+                       struct dentry *dentry, struct inode *inode,
+                       const char *name, void *buffer, size_t size)
+{
+       return ovl_xattr_get(dentry, handler->name, buffer, size);
+}
+
 static int __maybe_unused
 ovl_posix_acl_xattr_set(const struct xattr_handler *handler,
                        struct dentry *dentry, struct inode *inode,
@@ -1029,6 +1037,13 @@ out_acl_release:
        return err;
 }
 
+static int ovl_own_xattr_get(const struct xattr_handler *handler,
+                            struct dentry *dentry, struct inode *inode,
+                            const char *name, void *buffer, size_t size)
+{
+       return -EPERM;
+}
+
 static int ovl_own_xattr_set(const struct xattr_handler *handler,
                             struct dentry *dentry, struct inode *inode,
                             const char *name, const void *value,
@@ -1037,6 +1052,13 @@ static int ovl_own_xattr_set(const struct xattr_handler *handler,
        return -EPERM;
 }
 
+static int ovl_other_xattr_get(const struct xattr_handler *handler,
+                              struct dentry *dentry, struct inode *inode,
+                              const char *name, void *buffer, size_t size)
+{
+       return ovl_xattr_get(dentry, name, buffer, size);
+}
+
 static int ovl_other_xattr_set(const struct xattr_handler *handler,
                               struct dentry *dentry, struct inode *inode,
                               const char *name, const void *value,
@@ -1049,6 +1071,7 @@ static const struct xattr_handler __maybe_unused
 ovl_posix_acl_access_xattr_handler = {
        .name = XATTR_NAME_POSIX_ACL_ACCESS,
        .flags = ACL_TYPE_ACCESS,
+       .get = ovl_posix_acl_xattr_get,
        .set = ovl_posix_acl_xattr_set,
 };
 
@@ -1056,16 +1079,19 @@ static const struct xattr_handler __maybe_unused
 ovl_posix_acl_default_xattr_handler = {
        .name = XATTR_NAME_POSIX_ACL_DEFAULT,
        .flags = ACL_TYPE_DEFAULT,
+       .get = ovl_posix_acl_xattr_get,
        .set = ovl_posix_acl_xattr_set,
 };
 
 static const struct xattr_handler ovl_own_xattr_handler = {
        .prefix = OVL_XATTR_PREFIX,
+       .get = ovl_own_xattr_get,
        .set = ovl_own_xattr_set,
 };
 
 static const struct xattr_handler ovl_other_xattr_handler = {
        .prefix = "", /* catch all */
+       .get = ovl_other_xattr_get,
        .set = ovl_other_xattr_set,
 };