From 009987c190f109dc4bd8e1fed6ded606295c7156 Mon Sep 17 00:00:00 2001 From: Xiangyang Yu Date: Fri, 2 Aug 2019 17:37:54 +0800 Subject: [PATCH] os/bluestore: [revert PR#29185] no need to add tail length Tail length is already caculated in add_buffer forward, so do not need to add tail length in adjust buffer size again. Signed-off-by: Xiangyang Yu --- src/os/bluestore/BlueStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 9233e159cf4..36099baf0f0 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1423,7 +1423,7 @@ int BlueStore::BufferSpace::_discard(BufferCacheShard* cache, uint32_t offset, u 0, b); } if (!b->is_writing()) { - cache->_adjust_size(b, tail + front - (int64_t)b->length); + cache->_adjust_size(b, front - (int64_t)b->length); } b->truncate(front); b->maybe_rebuild(); -- 2.47.3