From dd93d0b6f33506eeaf72a1c3ebc8f5c5ff945ac4 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Tue, 9 Apr 2024 13:13:37 +0200 Subject: [PATCH] Revert "os/bluestore: fix bad buffer_cache_write" This reverts commit eff64c1095fa7567a6590368e348ef3ec11f632c. Signed-off-by: Pere Diaz Bou --- src/os/bluestore/BlueStore.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1023f8ec5635a..4d38eb9967af9 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -15475,7 +15475,6 @@ void BlueStore::_do_write_small( b_len % chunk_size == 0 && b->get_blob().is_allocated(b_off, b_len)) { - _buffer_cache_write(txc, o, offset, bl, wctx->buffered ? 0 : Buffer::FLAG_NOCACHE); _apply_padding(head_pad, tail_pad, bl); dout(20) << __func__ << " reading head 0x" << std::hex << head_read @@ -15509,6 +15508,11 @@ void BlueStore::_do_write_small( } logger->inc(l_bluestore_write_small_pre_read); + bufferlist without_padding; + without_padding.substr_of(bl, head_pad, bl.length() - head_pad); + _buffer_cache_write(txc, o, offset - head_read, std::move(without_padding), + wctx->buffered ? 0 : Buffer::FLAG_NOCACHE); + b->dirty_blob().calc_csum(b_off, bl); if (!g_conf()->bluestore_debug_omit_block_device_write) { -- 2.39.5