summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-04-22 09:47:22 -0700
committerDarrick J. Wong <djwong@kernel.org>2024-04-23 07:46:51 -0700
commitc27411d4c640037d70e2fa5751616e175e52ca5e (patch)
treedd25c9f1b8a510a12c98f9ceb2611d7204947cd5 /fs/xfs/xfs_ioctl.c
parent54275d8496f3e4764302cebc0e9517d950ba6589 (diff)
xfs: make attr removal an explicit operation
Parent pointers match attrs on name+value, unlike everything else which matches on only the name. Therefore, we cannot keep using the heuristic that !value means remove. Make this an explicit operation code. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 0eca7a9096e2..e30f9f40f086 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -363,13 +363,16 @@ xfs_attr_filter(
static inline enum xfs_attr_update
xfs_xattr_flags(
- u32 ioc_flags)
+ u32 ioc_flags,
+ void *value)
{
+ if (!value)
+ return XFS_ATTRUPDATE_REMOVE;
if (ioc_flags & XFS_IOC_ATTR_CREATE)
return XFS_ATTRUPDATE_CREATE;
if (ioc_flags & XFS_IOC_ATTR_REPLACE)
return XFS_ATTRUPDATE_REPLACE;
- return XFS_ATTRUPDATE_UPSERTR;
+ return XFS_ATTRUPDATE_UPSERT;
}
int
@@ -526,7 +529,7 @@ xfs_attrmulti_attr_set(
args.valuelen = len;
}
- error = xfs_attr_change(&args, xfs_xattr_flags(flags));
+ error = xfs_attr_change(&args, xfs_xattr_flags(flags, args.value));
if (!error && (flags & XFS_IOC_ATTR_ROOT))
xfs_forget_acl(inode, name);
kfree(args.value);