]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: rebuild attrs from clients 22858/head
authorSage Weil <sage@redhat.com>
Wed, 4 Jul 2018 19:19:04 +0000 (14:19 -0500)
committerSage Weil <sage@redhat.com>
Wed, 4 Jul 2018 19:19:04 +0000 (14:19 -0500)
Ensure that buffers coming in via client ops are rebuilt before populating
the PGTransaction.  This ensures that we don't pin the raw buffers for
the entire incoming message in memory.

In the past we've addressed this issue at the ObjectStore layer, but we
did not consider the attr_cache in ObjectContext.  Rebuilding the buffers
at this point will sanitize any incoming attribute before it reaches
either PGBackend or ObjectContext object_cache or the ObjectStore
implementation.

Fixes: http://tracker.ceph.com/issues/24768
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PGTransaction.h

index 2e0fdfbb702c5d3f0de1a2aa142b58d53ac38cd3..7a15f3bdba3c1e988e288446189be1298e6f2bdb 100644 (file)
@@ -363,7 +363,9 @@ public:
     ) {
     auto &op = get_object_op_for_modify(hoid);
     for (auto &&i: attrs) {
-      op.attr_updates[i.first] = i.second;
+      auto& d = op.attr_updates[i.first];
+      d = i.second;
+      d->rebuild();
     }
   }
   void setattr(
@@ -372,7 +374,9 @@ public:
     bufferlist &bl                 ///< [in] val to write, may be claimed
     ) {
     auto &op = get_object_op_for_modify(hoid);
-    op.attr_updates[attrname] = bl;
+    auto& d = op.attr_updates[attrname];
+    d = bl;
+    d->rebuild();
   }
   void rmattr(
     const hobject_t &hoid,         ///< [in] object to write