From 7302e890f1caebfa992361e86df352ced2a52c7d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 5 Sep 2019 11:09:27 -0500 Subject: [PATCH] messages/MOSDOpReply: assert no write result payloads Historically, we have cleared any outdata for writes. Soon we will start allowing these by recording them in the pglog. First, let's assert these are empty to ensure that aren't any misbehaving users we don't know about. We only assert the *write* ops have no output buffer, since there may be a compound op that is preceded by read ops. Signed-off-by: Sage Weil --- src/messages/MOSDOpReply.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/messages/MOSDOpReply.h b/src/messages/MOSDOpReply.h index c35b7ace671..657f7403635 100644 --- a/src/messages/MOSDOpReply.h +++ b/src/messages/MOSDOpReply.h @@ -148,8 +148,12 @@ public: // zero out ops payload_len and possibly out data for (unsigned i = 0; i < ops.size(); i++) { ops[i].op.payload_len = 0; - if (ignore_out_data) - ops[i].outdata.clear(); + if (ignore_out_data && + (ceph_osd_op_mode_modify(ops[i].op.op) || + ceph_osd_op_mode_cache(ops[i].op.op))) { + // WIP: we will soon support some limited payload here + ceph_assert(ops[i].outdata.length() == 0); + } } } private: -- 2.39.5