From 82fa73a411338f4bd27eb9b5863bf5b800617a67 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 9 Jan 2020 13:02:04 -0500 Subject: [PATCH] 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 --- src/os/bluestore/BlueFS.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 26572052dfa..1ace095ae3f 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. -- 2.39.5