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>
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();