From 91f6f8fdb1875d400ad6424df059a45c51579788 Mon Sep 17 00:00:00 2001 From: Xiangyang Yu Date: Wed, 24 Jul 2019 09:30:10 +0800 Subject: [PATCH] os/bluestore: it's better to erase spanning blob only once when several extents use the same spanning blob, we reclaim the blob if all Pextent are to be released, but we erase the spanning blob from spanning blob map several times. Although it's not a error, I think it's better to erase the spanning blob with the last Oldextent who's blob empty flag will be set true. Signed-off-by: Xiangyang Yu --- src/os/bluestore/BlueStore.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 52ebc5004f6..7e236641de3 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -12342,12 +12342,13 @@ void BlueStore::_wctx_finish( txc->statfs_delta.compressed_allocated() -= e.length; } } - delete &lo; - if (b->is_spanning() && !b->is_referenced()) { + + if (b->is_spanning() && !b->is_referenced() && lo.blob_empty) { dout(20) << __func__ << " spanning_blob_map removing empty " << *b << dendl; o->extent_map.spanning_blob_map.erase(b->id); } + delete &lo; } } -- 2.39.5