If a client sets an xattr and then attempts to remove in a short
time window, the xattr may not have been committed to the journal
and will only be set on the projected xattrs of the inode. This
results in a removexattr returning ENODATA at present. The fix
here checks the xattr name in the projected xattrs, and only
returns ENODATA in the case where the name doesn't exist in that
map either.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
return;
string name(req->get_path2());
- if (cur->xattrs.count(name) == 0) {
+
+ map<string, bufferptr> *pxattrs = cur->get_projected_xattrs();
+ if (pxattrs->count(name) == 0) {
dout(10) << "removexattr '" << name << "' and ENODATA on " << *cur << dendl;
reply_request(mdr, -ENODATA);
return;