From: Sage Weil Date: Thu, 5 Sep 2019 16:10:23 +0000 (-0500) Subject: osd/PrimaryLogPG: assert write result == 0 X-Git-Tag: v15.1.0~1582^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bfc4c06a34c9bb37ccc21fa7a73f709127588805;p=ceph.git osd/PrimaryLogPG: assert write result == 0 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 --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 127714aabf5..6b60e6c5352 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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);