]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: _delete_head should adjust pending_attrs
authorSamuel Just <sam.just@inktank.com>
Sun, 9 Mar 2014 18:41:48 +0000 (11:41 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 10 Mar 2014 23:03:29 +0000 (16:03 -0700)
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>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 1f85dd7b23f3e516d71280cae3dfae7a09bc561a..2d8d60bf13cc83ad816b80bd3b6badb7ebd878e1 100644 (file)
@@ -4479,7 +4479,8 @@ inline int ReplicatedPG::_delete_head(OpContext *ctx, bool no_whiteout)
     } 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);
index 7e2274df8884e52e43c3b7346ce677c0577e26e7..969a094e74c9c33ba2161586526301291f679d74 100644 (file)
@@ -477,14 +477,18 @@ public:
             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();