From: Anoop C S Date: Mon, 8 Jan 2024 11:47:59 +0000 (+0530) Subject: client: Add exception to POSIX ACL xattrs in removexattr X-Git-Tag: v19.1.0~216^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e03bbb116a66f2be30030f8dce51ea1a65e9c3df;p=ceph.git 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) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 96286bfe564d..3ea3b674eae9 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -14069,7 +14069,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); @@ -14085,6 +14087,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;