]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: set shared_blob to nullptr on unshare
authorPere Diaz Bou <pere-altea@hotmail.com>
Fri, 2 Feb 2024 12:15:50 +0000 (13:15 +0100)
committerPere Diaz Bou <pere-altea@hotmail.com>
Thu, 8 Feb 2024 11:16:36 +0000 (12:16 +0100)
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
src/os/bluestore/BlueStore.cc

index 99d12f3f22f82e00fd100c8883ac2a1dd8a335ca..7714caaad44b59cb9a18a1d09bd1b8b1007ab959 100644 (file)
@@ -16899,17 +16899,7 @@ int BlueStore::_do_remove(
       dout(20) << __func__ << "  unsharing " << e << dendl;
       bluestore_blob_t& blob = e.blob->dirty_blob();
       blob.clear_flag(bluestore_blob_t::FLAG_SHARED);
-      if (e.blob->get_shared_blob()->nref > 1) {
-       // Each blob on creation gets its own unique (empty) shared_blob.
-       // In function ExtentMap::dup() we sometimes merge 2 blobs,
-       // so they share common shared_blob used for ref counting.
-       // Imagine 2 blobs having same shared_blob, and shared blob gets just unshared.
-       // We cleared shared_blob content so it is now logically empty,
-       // but now those 2 blobs share it.
-       // This is illegal, as empty shared blobs should be unique.
-       // Fixing by re-creation.
-        e.blob->get_dirty_shared_blob() = nullptr;
-      }
+      e.blob->get_dirty_shared_blob() = nullptr;
       h->extent_map.dirty_range(e.logical_offset, 1);
     }
   }