We need the old attr_cache in make_writeable for the clone,
so make the changes to pending_attrs.
Fixes: #7663
Signed-off-by: Samuel Just <sam.just@inktank.com>
} else {
t->remove(soid);
}
- ctx->obc->attr_cache.clear();
+ map<string, bufferlist> new_attrs;
+ replace_cached_attrs(ctx, ctx->obc, new_attrs);
} else {
ctx->mod_desc.mark_unrollbackable();
t->remove(soid);
pending_attrs.begin();
i != pending_attrs.end();
++i) {
- for (map<string, boost::optional<bufferlist> >::iterator j =
- i->second.begin();
- j != i->second.end();
- ++j) {
- if (j->second)
- i->first->attr_cache[j->first] = j->second.get();
- else
- i->first->attr_cache.erase(j->first);
+ if (i->first->obs.exists) {
+ for (map<string, boost::optional<bufferlist> >::iterator j =
+ i->second.begin();
+ j != i->second.end();
+ ++j) {
+ if (j->second)
+ i->first->attr_cache[j->first] = j->second.get();
+ else
+ i->first->attr_cache.erase(j->first);
+ }
+ } else {
+ i->first->attr_cache.clear();
}
}
pending_attrs.clear();