vfs: forbid using xattr interfaces for fscaps
All relevant filesystems now handle fscaps via the type-safe inode
operations, and all code has been updated to use the new vfs-level
fscaps interfaces instead of xattr interfaces. We can now block any use
of the vfs xattr interfaces for passing raw fscaps xattrs to
filesystems to enforce use of the new interfaces.
Signed-off-by: Seth Forshee (DigitalOcean) <sforshee@kernel.org>
diff --git a/fs/xattr.c b/fs/xattr.c
index 213dffe..16f5e03 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -415,7 +415,7 @@ __vfs_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
{
const struct xattr_handler *handler;
- if (is_posix_acl_xattr(name))
+ if (is_posix_acl_xattr(name) || is_fscaps_xattr(name))
return -EOPNOTSUPP;
handler = xattr_resolve_name(inode, &name);
@@ -633,7 +633,7 @@ __vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
{
const struct xattr_handler *handler;
- if (is_posix_acl_xattr(name))
+ if (is_posix_acl_xattr(name) || is_fscaps_xattr(name))
return -EOPNOTSUPP;
handler = xattr_resolve_name(inode, &name);
@@ -728,7 +728,7 @@ __vfs_removexattr(struct mnt_idmap *idmap, struct dentry *dentry,
struct inode *inode = d_inode(dentry);
const struct xattr_handler *handler;
- if (is_posix_acl_xattr(name))
+ if (is_posix_acl_xattr(name) || is_fscaps_xattr(name))
return -EOPNOTSUPP;
handler = xattr_resolve_name(inode, &name);