]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MOSDOpReply: assert no write result payloads
authorSage Weil <sage@redhat.com>
Thu, 5 Sep 2019 16:09:27 +0000 (11:09 -0500)
committerSage Weil <sage@redhat.com>
Fri, 6 Sep 2019 02:13:52 +0000 (21:13 -0500)
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>
src/messages/MOSDOpReply.h

index c35b7ace671d996c1ab50a3a4bc8a61eeb2cf106..657f7403635860c973b681a889bbd12e2fcf9b3a 100644 (file)
@@ -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: