diff options
author | Christoph Hellwig <hch@lst.de> | 2020-01-07 15:25:38 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-01-09 10:55:18 -0800 |
commit | 8cde9f259c7d91d05b12cc68993a9643d6b4e45f (patch) | |
tree | f43e9bfaeb6b4a9bf79538995207d27bee1c6809 /fs/xfs/xfs_xattr.c | |
parent | 84fd081f8ae92e05ace47d24e58f26f7af2994c7 (diff) | |
download | lwn-8cde9f259c7d91d05b12cc68993a9643d6b4e45f.tar.gz lwn-8cde9f259c7d91d05b12cc68993a9643d6b4e45f.zip |
xfs: also remove cached ACLs when removing the underlying attr
We should not just invalidate the ACL when setting the underlying
attribute, but also when removing it. The ioctl interface gets that
right, but the normal xattr inteface skipped the xfs_forget_acl due
to an early return.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_xattr.c')
-rw-r--r-- | fs/xfs/xfs_xattr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 383f0203d103..2288f20ae282 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c @@ -74,10 +74,11 @@ xfs_xattr_set(const struct xattr_handler *handler, struct dentry *unused, if (flags & XATTR_REPLACE) xflags |= ATTR_REPLACE; - if (!value) - return xfs_attr_remove(ip, (unsigned char *)name, xflags); - error = xfs_attr_set(ip, (unsigned char *)name, + if (value) + error = xfs_attr_set(ip, (unsigned char *)name, (void *)value, size, xflags); + else + error = xfs_attr_remove(ip, (unsigned char *)name, xflags); if (!error) xfs_forget_acl(inode, name, xflags); |