From: Samuel Just Date: Wed, 13 Aug 2025 16:54:35 +0000 (-0700) Subject: crimson/.../fixed_kv_node: don't call copy_out if delta_buffer is empty X-Git-Tag: v21.0.0~50^2~180^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F65017%2Fhead;p=ceph.git crimson/.../fixed_kv_node: don't call copy_out if delta_buffer is empty 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 --- diff --git a/src/crimson/os/seastore/btree/fixed_kv_node.h b/src/crimson/os/seastore/btree/fixed_kv_node.h index 23d3b38f84be..f27c042bdf0a 100644 --- a/src/crimson/os/seastore/btree/fixed_kv_node.h +++ b/src/crimson/os/seastore/btree/fixed_kv_node.h @@ -440,7 +440,11 @@ struct FixedKVInternalNode } 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);