Actions
Bug #2828
closedosd: assign_bid was allowed to mutate and return data
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
OSD
Target version:
-
% Done:
0%
Source:
Development
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
The osd shouldn't have allowed this. Figure out why, and then see if there is a graceful way to fix it without breaking old rbd clients. :)
Updated by Sage Weil over 11 years ago
this block in ReplicatedPG.cc should also blow away the outdata on the osd_ops:
// Write operations aren't allowed to return a data payload because // we can't do so reliably. If the client has to resend the request // and it has already been applied, we will return 0 with no // payload. Non-deterministic behavior is no good. However, it is // possible to construct an operation that does a read, does a guard // check (e.g., CMPXATTR), and then a write. Then we either succeed // with the write, or return a CMPXATTR and the read value. if (ctx->op_t.empty() && !ctx->modify) { // read. ctx->reply->claim_op_out_data(ctx->ops); ctx->reply->get_header().data_off = ctx->data_off; } else { // write. normalize the result code. if (result > 0) result = 0; }
...except that rbd.assign_bid used to rely on that behavior. That is only used by 'rbd create ...' and not by clients themselves, so we can probably fix this safely.
Reading the code, i'm not sure how it is that it actually worked, however.
Actions