summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2024-03-04 04:38:28 +0100
committerXiubo Li <xiubli@redhat.com>2024-06-28 07:01:08 +0200
commit797e92692196122fb9dc26617904379cc777bd2b (patch)
treeab65d286d6979b4a0be1069f8a8d637e6b7574fe /src/include
parentMerge PR #57619 into main (diff)
downloadceph-797e92692196122fb9dc26617904379cc777bd2b.tar.xz
ceph-797e92692196122fb9dc26617904379cc777bd2b.zip
mds/client: 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. Added a CEPH_XATTR_REMOVE2 new flags and will return -ENODATA errno directly when the crresponding xattr doesn't exist. Just keeps the old CEPH_XATTR_REMOVE flags to make it to be compatible with old clients. Fixes: https://tracker.ceph.com/issues/64679 Signed-off-by: Xiubo Li <xiubli@redhat.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ceph_fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h
index a6ee2737710..57eb18b0d3e 100644
--- a/src/include/ceph_fs.h
+++ b/src/include/ceph_fs.h
@@ -488,6 +488,7 @@ int ceph_flags_sys2wire(int flags);
*/
#define CEPH_XATTR_CREATE (1 << 0)
#define CEPH_XATTR_REPLACE (1 << 1)
+#define CEPH_XATTR_REMOVE2 (1 << 30)
#define CEPH_XATTR_REMOVE (1 << 31)
/*