]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/transaction_manager: verify type in read_pin_by_type
authorYingxin Cheng <yingxin.cheng@intel.com>
Mon, 25 Nov 2024 07:11:11 +0000 (15:11 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 28 Nov 2024 06:19:18 +0000 (14:19 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/transaction_manager.h

index 5bd3c679dda23753b6dc529ddc48291dbfe6830b..0317d3b4bb888755a0045a372ffd8a618a1ceceb 100644 (file)
@@ -993,7 +993,11 @@ private:
     // checking the lba child must be atomic with creating
     // and linking the absent child
     if (v.has_child()) {
-      return std::move(v.get_child_fut());
+      return std::move(v.get_child_fut()
+      ).si_then([type](auto ext) {
+        ceph_assert(ext->get_type() == type);
+        return ext;
+      });
     } else {
       return pin_to_extent_by_type(t, std::move(pin), type);
     }