The MDS currently returns success on a removexattr if the xattr map is
completely empty. Fix the subtle logic bug and have it return -ENODATA
in that case.
Fixes: https://tracker.ceph.com/issues/49833
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit
85e73c7c7509cefbc50902436aca07a9a333eb23)
}
if (op == CEPH_MDS_OP_RMXATTR) {
- if (xattrs && xattrs->count(mempool::mds_co::string(xattr_name)) == 0) {
+ if (!xattrs || xattrs->count(mempool::mds_co::string(xattr_name)) == 0) {
dout(10) << "removexattr '" << xattr_name << "' and CEPHFS_ENODATA on " << *cur << dendl;
return -CEPHFS_ENODATA;
}