Skip to content

Commit

Permalink
messages/MOSDOpReply: assert no write result payloads
Browse files Browse the repository at this point in the history
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 <sage@redhat.com>
  • Loading branch information
liewegas committed Sep 6, 2019
1 parent bfc4c06 commit 7302e89
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/messages/MOSDOpReply.h
Expand Up @@ -148,8 +148,12 @@ class MOSDOpReply : public Message {
// 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:
Expand Down

0 comments on commit 7302e89

Please sign in to comment.