]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds/client: return -ENODATA when xattr doesn't exist for removexattr
authorXiubo Li <xiubli@redhat.com>
Mon, 4 Mar 2024 03:38:28 +0000 (11:38 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 24 Jul 2024 02:47:36 +0000 (10:47 +0800)
commit01a0282b3e974be5dc2f7b878a0a133fa42dd273
treeeab4395afc1516db26da706002e2798e51bcbffe
parenta3bbd7289877bdcce87fd1f79da1a2d6578dde36
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>
(cherry picked from commit 797e92692196122fb9dc26617904379cc777bd2b)
src/client/Client.cc
src/include/ceph_fs.h
src/mds/Server.cc