]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: properly reset zoned allocator on startup
authorSage Weil <sage@newdream.net>
Fri, 3 Sep 2021 21:41:27 +0000 (16:41 -0500)
committerSage Weil <sage@newdream.net>
Fri, 29 Oct 2021 13:55:57 +0000 (09:55 -0400)
Signed-off-by: Sage Weil <sage@newdream.net>
src/os/bluestore/BlueStore.cc
src/os/bluestore/ZonedAllocator.cc

index bd22830f7277ee3b8ff37d380d9e7fb0e4cf1265..39c2865b3434208cbbafe610e5fe4c1304464c8a 100644 (file)
@@ -6695,6 +6695,7 @@ int BlueStore::mkfs()
     freelist_type = "zoned";
     zone_size = bdev->get_zone_size();
     first_sequential_zone = bdev->get_conventional_region_size() / zone_size;
+    bdev->reset_all_zones();
   } else
 #endif
   {
index 499cd72bf2f99ecaf45348011105f3d99d970b2a..6425919639892e71c6223b06635236e6387c20ba 100644 (file)
@@ -42,6 +42,9 @@ ZonedAllocator::ZonedAllocator(CephContext* cct,
                 << std::dec
                 << dendl;
   ceph_assert(size % zone_size == 0);
+
+  zone_states.resize(num_zones);
+  num_free = num_zones * zone_size;
 }
 
 ZonedAllocator::~ZonedAllocator()