Skip to content

Commit 18e473b

Browse files
authored
Merge pull request ceph#63295 from tchaikov/rbd-cache-pwl-fix-leaks
librbd/cache/pwl: fix memory leak in SyncPoint persist context cleanup Reviewed-by: Yin Congmin <[email protected]> Reviewed-by: Ilya Dryomov <[email protected]>
2 parents 4b5f967 + 05fd6f9 commit 18e473b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/librbd/cache/pwl/AbstractWriteLog.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,20 @@ void AbstractWriteLog<I>::shut_down(Context *on_finish) {
662662
periodic_stats();
663663

664664
std::unique_lock locker(m_lock);
665+
666+
ceph_assert(m_current_sync_point);
667+
if (!m_current_sync_point->earlier_sync_point) {
668+
// This is the only sync point, hence no need to wait for the persistence
669+
// of prior sync points.
670+
m_current_sync_point->prior_persisted_gather_activate();
671+
// we don't create a new sync point, if there are no writes in current sync point's
672+
// log entry.
673+
ceph_assert(m_current_sync_point->log_entry->writes == 0);
674+
// In that case, we shold not wait for the log entry's persistence of current
675+
// sync point, which is otherwise waited until we flush its prior sync point.
676+
m_current_sync_point->persist_gather_activate();
677+
}
678+
665679
check_image_cache_state_clean();
666680
m_wake_up_enabled = false;
667681
m_log_entries.clear();

0 commit comments

Comments
 (0)