]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: assert write result == 0
authorSage Weil <sage@redhat.com>
Thu, 5 Sep 2019 16:10:23 +0000 (11:10 -0500)
committerSage Weil <sage@redhat.com>
Fri, 6 Sep 2019 02:13:49 +0000 (21:13 -0500)
Historically, we have zeroed the result for any successful write op.
Soon, we will allow results >= 0 (e.g., from cls ops).  First, let's assert
these are zero, so we can catch any misbehaving users.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PrimaryLogPG.cc

index 127714aabf563a2f836be97fe4a36fcc10134315..6b60e6c5352a250ed13d445cfb6a16403e55d7a1 100644 (file)
@@ -3694,9 +3694,11 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
   // check (e.g., CMPXATTR), and then a write.  Then we either succeed
   // with the write, or return a CMPXATTR and the read value.
   if (successful_write) {
-    // write.  normalize the result code.
-    dout(20) << " zeroing write result code " << result << dendl;
-    result = 0;
+    // WIP: we will soon support a >=0 result code here.
+    if (result) {
+      derr << " non-zero write result code " << result << dendl;
+      ceph_assert(result == 0);
+    }
   }
   ctx->reply->set_result(result);