From: Samuel Just Date: Sun, 9 Mar 2014 18:41:48 +0000 (-0700) Subject: ReplicatedPG: _delete_head should adjust pending_attrs X-Git-Tag: v0.78~46^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6669e4d69ec2eff2cde3322673b9c8bf265239f4;p=ceph.git ReplicatedPG: _delete_head should adjust pending_attrs 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1f85dd7b23f3..2d8d60bf13cc 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4479,7 +4479,8 @@ inline int ReplicatedPG::_delete_head(OpContext *ctx, bool no_whiteout) } else { t->remove(soid); } - ctx->obc->attr_cache.clear(); + map new_attrs; + replace_cached_attrs(ctx, ctx->obc, new_attrs); } else { ctx->mod_desc.mark_unrollbackable(); t->remove(soid); diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 7e2274df8884..969a094e74c9 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -477,14 +477,18 @@ public: pending_attrs.begin(); i != pending_attrs.end(); ++i) { - for (map >::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 >::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();