From: Samuel Just Date: Sat, 1 Mar 2014 21:39:57 +0000 (-0800) Subject: MOSDOp: drop ops vector in clear_data() X-Git-Tag: v0.78~106^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc9b8ef06bf95526df60bfcbf954b969e3892c15;p=ceph.git 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 --- 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; }