In SyncPointLogOperation::clear_earlier_sync_point(),
sync_point->log_entry->next_sync_point_entry was prematurely set to
nullptr in clear_earlier_sync_point(). It is in write op stage, but
next_sync_point_entry is used in writeback stage in
handle_flushed_sync_point().
handle_flushed_sync_point() may pass a nullptr
cause assert in m_work_queue.The solution is to move the statement
that set next_sync_point_entry to nullptr after it is used.
Fixes: https://tracker.ceph.com/issues/52465
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
}
m_async_op_tracker.start_op();
m_work_queue.queue(new LambdaContext(
- [this, log_entry](int r) {
+ [this, next = std::move(log_entry->next_sync_point_entry)](int r) {
bool handled_by_next;
{
std::lock_guard locker(m_lock);
- handled_by_next = handle_flushed_sync_point(log_entry->next_sync_point_entry);
+ handled_by_next = handle_flushed_sync_point(std::move(next));
}
if (!handled_by_next) {
persist_last_flushed_sync_gen();
ceph_assert(sync_point->later_sync_point->earlier_sync_point == sync_point);
sync_point->later_sync_point->earlier_sync_point = nullptr;
sync_point->later_sync_point = nullptr;
- sync_point->log_entry->next_sync_point_entry = nullptr;
}
std::vector<Context*> SyncPointLogOperation::swap_on_sync_point_persisted() {