]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: it's better to erase spanning blob only once
authorXiangyang Yu <penglaiyxy@gmail.com>
Wed, 24 Jul 2019 01:30:10 +0000 (09:30 +0800)
committerXiangyang Yu <penglaiyxy@gmail.com>
Wed, 24 Jul 2019 01:46:26 +0000 (09:46 +0800)
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 <penglaiyxy@gmail.com>
src/os/bluestore/BlueStore.cc

index 52ebc5004f6ef6b9bbc906840979cd222cdd0fe1..7e236641de34480ca16216ac91ef0bba691696cf 100644 (file)
@@ -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;
   }
 }