]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: check the type of segment head and segment tail during mount 51634/head
authorZhang Song <zhangsong325@gmail.com>
Tue, 4 Apr 2023 01:34:06 +0000 (09:34 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 21 May 2023 09:11:55 +0000 (09:11 +0000)
Signed-off-by: Zhang Song <zhangsong325@gmail.com>
(cherry picked from commit b890de1c2fe489e05804a2724ad3493c0114732e)

src/crimson/os/seastore/async_cleaner.cc

index 7d73adcbe20ada9ae5dae324ca26bf5c054ecebb..8f321b8e50dc281c965137213fb3b0de8991991a 100644 (file)
@@ -1301,6 +1301,7 @@ SegmentCleaner::mount_ret SegmentCleaner::mount()
         if (tail.segment_nonce != header.segment_nonce) {
           return scan_no_tail_segment(header, segment_id);
         }
+        ceph_assert(header.get_type() == tail.get_type());
 
         sea_time_point modify_time = mod_to_timepoint(tail.modify_time);
         std::size_t num_extents = tail.num_extents;