Skip to content

Commit a17dcce

Browse files
committed
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 <[email protected]>
1 parent 655aedf commit a17dcce

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/client/Client.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14071,7 +14071,9 @@ int Client::_removexattr(Inode *in, const char *name, const UserPerm& perms)
1407114071
if (strncmp(name, "user.", 5) &&
1407214072
strncmp(name, "security.", 9) &&
1407314073
strncmp(name, "trusted.", 8) &&
14074-
strncmp(name, "ceph.", 5))
14074+
strncmp(name, "ceph.", 5) &&
14075+
strcmp(name, ACL_EA_ACCESS) &&
14076+
strcmp(name, ACL_EA_DEFAULT))
1407514077
return -CEPHFS_EOPNOTSUPP;
1407614078

1407714079
const VXattr *vxattr = _match_vxattr(in, name);
@@ -14087,6 +14089,11 @@ int Client::_removexattr(Inode *in, const char *name, const UserPerm& perms)
1408714089

1408814090
int res = make_request(req, perms);
1408914091

14092+
if ((!strcmp(name, ACL_EA_ACCESS) ||
14093+
!strcmp(name, ACL_EA_DEFAULT)) &&
14094+
res == -CEPHFS_ENODATA)
14095+
res = 0;
14096+
1409014097
trim_cache();
1409114098
ldout(cct, 8) << "_removexattr(" << in->ino << ", \"" << name << "\") = " << res << dendl;
1409214099
return res;

0 commit comments

Comments
 (0)