Commit 8bac66c0 authored by Rainer Toebbicke's avatar Rainer Toebbicke

FUSEX,MGM: EOS-2793 removexattr fails to remove attribute from mgm metadata

parent ce15a38e
......@@ -2668,6 +2668,18 @@ FuseServer::HandleMD(const std::string& id,
}
}
size_t numAttr = cmd->numAttributes();
if (op != CREATE && numAttr != md.attr().size()) { /* an attribute got removed */
eos::IContainerMD::XAttrMap cmap = cmd->getAttributes();
for (auto it = cmap.begin(); it != cmap.end(); ++it) {
if (md.attr().find(it->first) == md.attr().end()) {
eos_static_debug("attr %s=%s has been removed", it->first.c_str(), it->second.c_str());
cmd->removeAttribute(it->first);
/* if ((--numAttr) == md.attr().size()) break; would be possible - under a lock! */
}
}
}
if (op == CREATE) {
// store the birth time as an extended attribute
char btime[256];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment