From 92859ed61f98ade2c4c8c75a0ddcea7745276da4 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 26 Mar 2014 17:43:19 -0700 Subject: [PATCH] ReplicatedPG: include pending_attrs when reseting attrs in WRITEFULL 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 --- src/osd/ReplicatedPG.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index faf00a720acac..641083d280a47 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3653,7 +3653,20 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& 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 to_set = ctx->obc->attr_cache; + map > &overlay = + ctx->pending_attrs[ctx->obc]; + for (map >::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(); -- 2.39.5