]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore/bluefs: make accounting resiliant to unlock() 36909/head
authorAdam Kupczyk <akupczyk@redhat.com>
Thu, 9 Jan 2020 18:02:04 +0000 (13:02 -0500)
committerIgor Fedotov <ifedotov@suse.com>
Mon, 31 Aug 2020 11:47:19 +0000 (14:47 +0300)
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 <akupczyk@redhat.com>
(cherry picked from commit 82fa73a411338f4bd27eb9b5863bf5b800617a67)

src/os/bluestore/BlueFS.cc

index 33fc1180d0932b3969ed91b23844169e177462e3..976ddcf4eb3231d79ac4c508f2f777a82bd7a13d 100644 (file)
@@ -2008,7 +2008,6 @@ void BlueFS::_compact_log_async(std::unique_lock<ceph::mutex>& 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;
@@ -2084,6 +2083,8 @@ void BlueFS::_compact_log_async(std::unique_lock<ceph::mutex>& 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.