]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: rebuild attrs from clients 22958/head 22959/head
authorKefu Chai <kchai@redhat.com>
Tue, 10 Jul 2018 08:59:29 +0000 (16:59 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 10 Jul 2018 09:22:03 +0000 (17:22 +0800)
Fixes: http://tracker.ceph.com/issues/24768
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/ECTransaction.h
src/osd/ReplicatedBackend.cc

index 17be72265cba4169cf42bd31a28be6dfe1d1f2d8..b22c1c921a73075ee9b2745721917fe5d239df9c 100644 (file)
@@ -63,11 +63,15 @@ public:
     map<string, bufferlist> attrs;
     SetAttrsOp(const hobject_t &oid, map<string, bufferlist> &_attrs)
       : oid(oid) {
+      for (auto& attr : attrs) {
+       attr.second.rebuild();
+      }
       attrs.swap(_attrs);
     }
     SetAttrsOp(const hobject_t &oid, const string &key, bufferlist &val)
       : oid(oid) {
-      attrs.insert(make_pair(key, val));
+      val.rebuild();
+      attrs.emplace(key, val);
     }
   };
   struct RmAttrOp {
index 5ba118496ff8d7aae57f85009b010d4005831a9b..53c6351f1f6feb18e12d4888c8a1514a10f1ac40 100644 (file)
@@ -368,6 +368,9 @@ public:
     const hobject_t &hoid,
     map<string, bufferlist> &attrs
     ) {
+    for (auto& attr : attrs) {
+      attr.second.rebuild();
+    }
     t.setattrs(get_coll(hoid), ghobject_t(hoid), attrs);
   }
   void setattr(
@@ -375,6 +378,7 @@ public:
     const string &attrname,
     bufferlist &bl
     ) {
+    bl.rebuild();
     t.setattr(get_coll(hoid), ghobject_t(hoid), attrname, bl);
   }
   void rmattr(