mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
crimson/os/seastore: initialize crc *after* read
Previously, all extents ended up initialized to the same crc value upon read -- the one for an empty buffer. This bug wasn't detected because an extent was always evicted and reread following the first write and subsequently kept in cache once initially written. Also, add crc to operator<< for extents. Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
9016932fef
commit
05c62821d9
@ -135,14 +135,14 @@ public:
|
||||
ref->set_paddr(offset);
|
||||
ref->state = CachedExtent::extent_state_t::CLEAN;
|
||||
|
||||
/* TODO: crc should be checked against LBA manager */
|
||||
ref->last_committed_crc = ref->get_crc32c();
|
||||
|
||||
return segment_manager.read(
|
||||
offset,
|
||||
length,
|
||||
ref->get_bptr()).safe_then(
|
||||
[this, ref=std::move(ref)]() mutable {
|
||||
/* TODO: crc should be checked against LBA manager */
|
||||
ref->last_committed_crc = ref->get_crc32c();
|
||||
|
||||
ref->on_clean_read();
|
||||
ref->complete_io();
|
||||
add_extent(ref);
|
||||
|
@ -120,6 +120,7 @@ public:
|
||||
<< ", version=" << version
|
||||
<< ", paddr=" << get_paddr()
|
||||
<< ", state=" << state
|
||||
<< ", last_committed_crc=" << last_committed_crc
|
||||
<< ", refcount=" << use_count();
|
||||
print_detail(out);
|
||||
return out << ")";
|
||||
|
Loading…
Reference in New Issue
Block a user