]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: return -ENODATA when xattr doesn't exist for removexattr
authorXiubo Li <xiubli@redhat.com>
Mon, 4 Mar 2024 02:25:00 +0000 (10:25 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 11 Feb 2026 18:19:16 +0000 (19:19 +0100)
commit594eecc164309b534c6d71f4d8269ca1915f1f14
tree4ea2fbdcccc4bcbbf2391fa9018c32d556d6f897
parent61969f2d05bda0e3802244f0a4f38c14bbe0d860
ceph: return -ENODATA when xattr doesn't exist for removexattr

The POSIX says we should return -ENODATA when the corresponding
attribute doesn't exist when removing it. While there is one
exception for the acl ones in the local filesystems, for exmaple
for xfs, which will treat it as success.

While in the MDS side there have two ways to remove the xattr:
sending a CEPH_MDS_OP_SETXATTR request by setting the 'flags' with
CEPH_XATTR_REMOVE and just issued a CEPH_MDS_OP_RMXATTR request
directly.

For the first one it will always return 0 when the corresponding
xattr doesn't exist, while for the later one it will return
-ENODATA instead, this should be fixed in MDS to make them to be
consistent.

And at the same time added a new flags CEPH_XATTR_REMOVE2 and in
MDS side it will return -ENODATA when the xattr doesn't exist.
While the CEPH_XATTR_REMOVE will be kept to be compatible with
old cephs.

Please note this commit also fixed a bug, which is that even when
the ACL xattrs don't exist the ctime/mode still will be updated.

URL: https://tracker.ceph.com/issues/64679
Signed-off-by: Xiubo Li <xiubli@redhat.com>
fs/ceph/acl.c
fs/ceph/xattr.c
include/linux/ceph/ceph_fs.h