From 2a2066acdcd5606a2315d307850597ffd461740f Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Mon, 8 Jan 2024 17:17:59 +0530 Subject: [PATCH] client: Add exception to POSIX ACL xattrs in removexattr With an exception to POSIX ACL xattrs all others from "system." namespace are found to return ENOTSUP during a removal attempt. Hence "system.posix_acl_access" and "system.posix_acl_default" are exempted thereby returning success despite their presence on files. Signed-off-by: Anoop C S (cherry picked from commit a17dccebba0fbc46ac0d3d57fca3f671b6a99bec) --- src/client/Client.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 2e099f26e68..1d3d019b72e 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -13312,7 +13312,9 @@ int Client::_removexattr(Inode *in, const char *name, const UserPerm& perms) if (strncmp(name, "user.", 5) && strncmp(name, "security.", 9) && strncmp(name, "trusted.", 8) && - strncmp(name, "ceph.", 5)) + strncmp(name, "ceph.", 5) && + strcmp(name, ACL_EA_ACCESS) && + strcmp(name, ACL_EA_DEFAULT)) return -CEPHFS_EOPNOTSUPP; const VXattr *vxattr = _match_vxattr(in, name); @@ -13328,6 +13330,11 @@ int Client::_removexattr(Inode *in, const char *name, const UserPerm& perms) int res = make_request(req, perms); + if ((!strcmp(name, ACL_EA_ACCESS) || + !strcmp(name, ACL_EA_DEFAULT)) && + res == -CEPHFS_ENODATA) + res = 0; + trim_cache(); ldout(cct, 8) << "_removexattr(" << in->ino << ", \"" << name << "\") = " << res << dendl; return res; -- 2.39.5