From: Sage Weil Date: Thu, 5 Sep 2019 16:09:27 +0000 (-0500) Subject: messages/MOSDOpReply: assert no write result payloads X-Git-Tag: v15.1.0~1582^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7302e890f1caebfa992361e86df352ced2a52c7d;p=ceph.git 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 --- diff --git a/src/messages/MOSDOpReply.h b/src/messages/MOSDOpReply.h index c35b7ace671d..657f74036358 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: