From: Adam Kupczyk Date: Thu, 9 Jan 2020 18:02:04 +0000 (-0500) Subject: bluestore/bluefs: make accounting resiliant to unlock() X-Git-Tag: v15.1.0~216^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=82fa73a411338f4bd27eb9b5863bf5b800617a67;p=ceph.git bluestore/bluefs: make accounting resiliant to unlock() Moved vselector.sub_usage, so sub_usage and add_usage will not cross _flush_bdev_safely(), which contains unlock(). Fixes: https://tracker.ceph.com/issues/43538 Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 26572052dfa4..1ace095ae3f7 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2240,7 +2240,6 @@ void BlueFS::_compact_log_async(std::unique_lock& l) flush_bdev(); // FIXME? _flush_and_sync_log(l, 0, old_log_jump_to); - vselector->sub_usage(log_file->vselector_hint, log_file->fnode); // 2. prepare compacted log bluefs_transaction_t t; @@ -2316,6 +2315,8 @@ void BlueFS::_compact_log_async(std::unique_lock& l) ++from; } + vselector->sub_usage(log_file->vselector_hint, log_file->fnode); + // clear the extents from old log file, they are added to new log log_file->fnode.clear_extents(); // swap the log files. New log file is the log file now.