]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: include pending_attrs when reseting attrs in WRITEFULL 1558/head
authorSamuel Just <sam.just@inktank.com>
Thu, 27 Mar 2014 00:43:19 +0000 (17:43 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 27 Mar 2014 00:43:22 +0000 (17:43 -0700)
This is necessary for ops like:

2014-03-25 11:48:20.354168 7f0df0ff9700  1 -- 192.168.106.226:0/1016231
--> 192.168.106.226:6814/13647 -- osd_op(client.4198.0:153
default.4198.1_foo [create 0~0,delete,setxattr user.rgw.idtag
(15),writefull 0~3,setxattr user.rgw.manifest (407),setxattr
user.rgw.acl (133),setxattr user.rgw.content_type (25),setxattr
user.rgw.etag (33)] 3.ee3a09ea ondisk+write e49) v4 -- ?+0 0xd09830 con
0xcd74d0

Fixes: #7837
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index faf00a720acac08de328df8a5acf0b41401d678b..641083d280a47e06ba85202439b23dbc0c9186d0 100644 (file)
@@ -3653,7 +3653,20 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          ctx->mod_desc.create();
          t->append(soid, op.extent.offset, op.extent.length, osd_op.indata);
          if (obs.exists) {
-           t->setattrs(soid, ctx->obc->attr_cache);
+           map<string, bufferlist> to_set = ctx->obc->attr_cache;
+           map<string, boost::optional<bufferlist> > &overlay =
+             ctx->pending_attrs[ctx->obc];
+           for (map<string, boost::optional<bufferlist> >::iterator i =
+                  overlay.begin();
+                i != overlay.end();
+                ++i) {
+             if (i->second) {
+               to_set[i->first] = *(i->second);
+             } else {
+               to_set.erase(i->first);
+             }
+           }
+           t->setattrs(soid, to_set);
          }
        } else {
          ctx->mod_desc.mark_unrollbackable();