From 0a0f8d5e6fa8276f06a9b7a7b18ea6f15fa8cb86 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 4 Jul 2018 14:19:04 -0500 Subject: [PATCH] osd/PrimaryLogPG: rebuild attrs from clients 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 --- src/osd/PGTransaction.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osd/PGTransaction.h b/src/osd/PGTransaction.h index 2e0fdfbb702c5..7a15f3bdba3c1 100644 --- a/src/osd/PGTransaction.h +++ b/src/osd/PGTransaction.h @@ -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 -- 2.39.5