From 77560484766e1f21b0dc9d7e0ee2803360665af7 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 13 Aug 2025 09:54:35 -0700 Subject: [PATCH] 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 --- src/crimson/os/seastore/btree/fixed_kv_node.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crimson/os/seastore/btree/fixed_kv_node.h b/src/crimson/os/seastore/btree/fixed_kv_node.h index 23d3b38f84bec..f27c042bdf0af 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); -- 2.39.5