Project

General

Profile

Bug #42091

bluefs: sync_metadata leaks dirty files if log_t is empty

Added by Xuehan Xu 6 months ago. Updated 4 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
mimic, nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

When reading the source code, we found that, in the following code, if BlueFS::log_t is empty while there are BlueFS::dirty_files is not, the latter one would be leaked.

void BlueFS::sync_metadata()
{
  std::unique_lock l(lock);
  if (log_t.empty()) {
    dout(10) << __func__ << " - no pending log events" << dendl;
  } else {
    dout(10) << __func__ << dendl;
    utime_t start = ceph_clock_now();
    flush_bdev(); // FIXME?
    _flush_and_sync_log(l);
    dout(10) << __func__ << " done in " << (ceph_clock_now() - start) << dendl;
  }

  if (_should_compact_log()) {
    if (cct->_conf->bluefs_compact_log_sync) {
      _compact_log_sync();
    } else {
      _compact_log_async(l);
    }
  }
}

Related issues

Copied to bluestore - Backport #43086: mimic: bluefs: sync_metadata leaks dirty files if log_t is empty New
Copied to bluestore - Backport #43087: nautilus: bluefs: sync_metadata leaks dirty files if log_t is empty New

History

#2 Updated by Nathan Cutler 6 months ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 30631

#3 Updated by Kefu Chai 4 months ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to mimic, nautilus

#4 Updated by Nathan Cutler 4 months ago

  • Copied to Backport #43086: mimic: bluefs: sync_metadata leaks dirty files if log_t is empty added

#5 Updated by Nathan Cutler 4 months ago

  • Copied to Backport #43087: nautilus: bluefs: sync_metadata leaks dirty files if log_t is empty added

Also available in: Atom PDF