]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: create dummy blob on dummy onodes
authorPere Diaz Bou <pere-altea@hotmail.com>
Mon, 27 Nov 2023 14:26:25 +0000 (15:26 +0100)
committerPere Diaz Bou <pere-altea@hotmail.com>
Thu, 8 Feb 2024 11:16:36 +0000 (12:16 +0100)
dummy onodes don't have a collection, consequentially, we need to create
a blob without a collection.

Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 9e3c72f6e3d81e807a47086b3c9f96f30398d995..3e08056bf9355c1dc4cca262d361d51fa6a77689 100644 (file)
@@ -4023,7 +4023,8 @@ void BlueStore::ExtentMap::ExtentDecoder::decode_extent(
     if (blobid) {
       consume_blobid(le, false, blobid - 1);
     } else {
-      BlobRef b = c->new_blob();
+      // dummy onodes might not have collections, we need a check for it.
+      BlobRef b = c ? c->new_blob() : new Blob(nullptr);
       uint64_t sbid = 0;
       b->decode(p, struct_v, &sbid, false, c);
       consume_blob(le, extent_pos, sbid, b);
@@ -4071,7 +4072,7 @@ void BlueStore::ExtentMap::ExtentDecoder::decode_spanning_blobs(
   unsigned n;
   denc_varint(n, p);
   while (n--) {
-    BlueStore::BlobRef b = c->new_blob();
+    BlobRef b = c ? c->new_blob() : new Blob(nullptr);
     denc_varint(b->id, p);
     uint64_t sbid = 0;
     b->decode(p, struct_v, &sbid, true, c);
@@ -11051,7 +11052,7 @@ void BlueStore::inject_zombie_spanning_blob(coll_t cid, ghobject_t oid,
     o->extent_map.fault_range(db, 0, OBJECT_MAX_SIZE);
   }
 
-  BlobRef b = c->new_blob();
+  BlobRef b = c ? c->new_blob() : new Blob(nullptr);
   b->id = blob_id;
   o->extent_map.spanning_blob_map[blob_id] = b;
 
index 7baaf503e39ac3466888e24858b9862e3b1b8128..9985ea5752ae27e782cedb6dca4ab68e60ba5638 100644 (file)
@@ -728,7 +728,7 @@ public:
       return shared_blob && shared_blob->is_loaded();
     }
     inline BufferCacheShard* get_cache() {
-      return collection->cache;
+      return collection ? collection->cache : nullptr;
     }
     uint64_t get_sbid() const {
       return shared_blob ? shared_blob->get_sbid() : 0;