From fc9b8ef06bf95526df60bfcbf954b969e3892c15 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sat, 1 Mar 2014 13:39:57 -0800 Subject: [PATCH] MOSDOp: drop ops vector in clear_data() Otherwise, clear_data on MOSDOp will leave essentially all of the buffers intact. This is a problem since the OpTracker mechanism relies on being able to keep the mesage around without keeping around the data. Signed-off-by: Samuel Just --- src/messages/MOSDOp.h | 3 +++ src/msg/Message.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index 32408bebeedb..5c70d8bbc47c 100644 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -337,6 +337,9 @@ struct ceph_osd_request_head { OSDOp::split_osd_op_vector_in_data(ops, data); } + void clear_buffers() { + ops.clear(); + } const char *get_type_name() const { return "osd_op"; } void print(ostream& out) const { diff --git a/src/msg/Message.h b/src/msg/Message.h index fbca242e2052..740be7be716c 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -403,10 +403,13 @@ public: payload.clear(); middle.clear(); } + + virtual void clear_buffers() {} void clear_data() { if (byte_throttler) byte_throttler->put(data.length()); data.clear(); + clear_buffers(); // let subclass drop buffers as well } bool empty_payload() { return payload.length() == 0; } -- 2.47.3