From bfc4c06a34c9bb37ccc21fa7a73f709127588805 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 5 Sep 2019 11:10:23 -0500 Subject: [PATCH] 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 --- src/osd/PrimaryLogPG.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 127714aabf563..6b60e6c5352a2 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); -- 2.39.5