In the event that an extent is created and removed in the same
transaction (invalid extent in fresh_block_list), update
block specific metadata but don't add to cache and especially
do not mark clean. LBAManager::complete_commit implementations
are meant to use skip based on state in the same way.
Signed-off-by: Samuel Just <sjust@redhat.com>
for (auto &i: t.fresh_block_list) {
i->set_paddr(cur);
cur.offset += i->get_length();
- i->state = CachedExtent::extent_state_t::CLEAN;
i->last_committed_crc = i->get_crc32c();
- logger().debug("complete_commit: fresh {}", *i);
i->on_initial_write();
+
+ if (!i->is_valid()) {
+ logger().debug("complete_commit: invalid {}", *i);
+ continue;
+ }
+
+ i->state = CachedExtent::extent_state_t::CLEAN;
+ logger().debug("complete_commit: fresh {}", *i);
add_extent(i);
}