Skip to content

squid: mds/client: return -ENODATA when xattr doesn't exist for removexattr#58526

Merged
lxbsz merged 4 commits intoceph:squidfrom
joscollin:wip-66777-squid
Jul 22, 2024
Merged

squid: mds/client: return -ENODATA when xattr doesn't exist for removexattr#58526
lxbsz merged 4 commits intoceph:squidfrom
joscollin:wip-66777-squid

Conversation

@joscollin
Copy link
Member

backport tracker: https://tracker.ceph.com/issues/66777


backport of #55945
parent tracker: https://tracker.ceph.com/issues/64679

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

lxbsz added 4 commits July 11, 2024 07:01
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 797e926)
Switch to use XATTR_CREATE.

Fixes: https://tracker.ceph.com/issues/64679
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit ec30c46)
There have two ways to remove xattrs, removexattr() and setxattr()
with the XATTR_REPLACE flags set.

Fixes: https://tracker.ceph.com/issues/64679
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 1a27670)
Fixes: https://tracker.ceph.com/issues/64679
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit b2a07f8)
@joscollin joscollin added this to the squid milestone Jul 11, 2024
@joscollin joscollin added the cephfs Ceph File System label Jul 11, 2024
@joscollin
Copy link
Member Author

jenkins test api

@joscollin joscollin added In Progress PR in progress and not yet ready for review. and removed In Progress PR in progress and not yet ready for review. labels Jul 11, 2024
@joscollin joscollin requested a review from a team July 11, 2024 05:44
@joscollin
Copy link
Member Author

This PR is under test in https://tracker.ceph.com/issues/66906.

Copy link
Member

@lxbsz lxbsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the failure is related to this backport PR:

More detail please see section 2024-07-17 in https://tracker.ceph.com/projects/cephfs/wiki/Squid.

@lxbsz lxbsz merged commit 0722069 into ceph:squid Jul 22, 2024
@joscollin joscollin deleted the wip-66777-squid branch July 23, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants