]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: fix ceph_assert in segment_manager.h 51475/head
authorAravind Ramesh <aravind.ramesh@wdc.com>
Mon, 15 May 2023 09:22:13 +0000 (11:22 +0200)
committerAravind Ramesh <aravind.ramesh@wdc.com>
Wed, 24 May 2023 09:57:39 +0000 (11:57 +0200)
Assert is seen when crimson-osd is compiled with -DWITH_ZNS=ON and
crimson-osd is started with a regular SSD.

ceph/src/crimson/os/seastore/segment_manager.h:77 : In function 'void crimson::os::seastore::block_sm_superblock_t::validate() const', ceph_assert(%s)
get_default_backend_of_device(config.spec.dtype) == backend_type_t::SEGMENTED

The device type "dtype" is not getting propogated properly
to BlockSegmentManager instantiation causing the assert at a
later point.

Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
src/crimson/os/seastore/segment_manager.cc

index dbba31fd2075630949cad7462c44fc2a6c069c4e..1be9cce5f6bf6867e59d446b17399c872410b177 100644 (file)
@@ -63,18 +63,26 @@ SegmentManager::get_segment_manager(
 LOG_PREFIX(SegmentManager::get_segment_manager);
   return seastar::do_with(
     static_cast<size_t>(0),
-    [&](auto &nr_zones) {
+    [FNAME,
+     dtype,
+     device](auto &nr_zones) {
       return seastar::open_file_dma(
        device + "/block",
        seastar::open_flags::rw
-      ).then([&](auto file) {
+      ).then([FNAME,
+             dtype,
+             device,
+             &nr_zones](auto file) {
        return seastar::do_with(
          file,
-         [=, &nr_zones](auto &f) -> seastar::future<int> {
+         [&nr_zones](auto &f) -> seastar::future<int> {
            ceph_assert(f);
            return f.ioctl(BLKGETNRZONES, (void *)&nr_zones);
          });
-      }).then([&](auto ret) -> crimson::os::seastore::SegmentManagerRef {
+      }).then([FNAME,
+              dtype,
+              device,
+              &nr_zones](auto ret) -> crimson::os::seastore::SegmentManagerRef {
        crimson::os::seastore::SegmentManagerRef sm;
        INFO("Found {} zones.", nr_zones);
        if (nr_zones != 0) {