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>
// 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);