Cache::mark_transaction_conflicted calls get_delta(), which in turn
calls FixedKVNodeLayout::copy_out for lba nodes. If the mutation_pending
extent happens not to have any deltas, it'll fail in memcpy in
FixedKVNodeLayout::copy_out.
I think this is valid because a transaction may become conflicted
between when duplicate_for_write is called and when the actual mutation
is performed on the extent.
Fixes: https://tracker.ceph.com/issues/72579
Signed-off-by: Samuel Just <sjust@redhat.com>
}
ceph::bufferlist get_delta() {
- ceph::buffer::ptr bptr(delta_buffer.get_bytes());
+ auto buffer_len = delta_buffer.get_bytes();
+ if (buffer_len == 0) {
+ return ceph::bufferlist();
+ }
+ ceph::buffer::ptr bptr(buffer_len);
delta_buffer.copy_out(bptr.c_str(), bptr.length());
ceph::bufferlist bl;
bl.push_back(bptr);