]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/seastore: fix omap empty delta buffer 47745/head
authorchunmei-liu <chunmei.liu@intel.com>
Mon, 22 Aug 2022 21:54:24 +0000 (14:54 -0700)
committerchunmei-liu <chunmei.liu@intel.com>
Tue, 23 Aug 2022 22:23:06 +0000 (15:23 -0700)
when rm_key get end iterator, don't do muatate
otherwise delta buffer will be empty and cause assert(delta.bl.lenght())

Signed-off-by: chunmei-liu <chunmei.liu@intel.com>
src/crimson/os/seastore/omap_manager/btree/omap_btree_node_impl.cc

index 890dd9232499ce4d625bd569dab7d7ba316e98db..11db3eb26bab8d8b1dd2723795075b2c9e6b0293 100644 (file)
@@ -552,12 +552,12 @@ OMapLeafNode::rm_key(omap_context_t oc, const std::string &key)
 {
   LOG_PREFIX(OMapLeafNode::rm_key);
   DEBUGT("{}, this: {}", oc.t, key, *this);
-  if(!is_pending()) {
+  auto rm_pt = find_string_key(key);
+  if (!is_pending() && rm_pt != iter_end()) {
     auto mut =  oc.tm.get_mutable_extent(oc.t, this)->cast<OMapLeafNode>();
     return mut->rm_key(oc, key);
   }
 
-  auto rm_pt = find_string_key(key);
   if (rm_pt != iter_end()) {
     ++(oc.t.get_omap_tree_stats().num_erases);
     journal_leaf_remove(rm_pt, maybe_get_delta_buffer());