]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore/bluefs: make accounting resiliant to unlock() 32584/head
authorAdam Kupczyk <akupczyk@redhat.com>
Thu, 9 Jan 2020 18:02:04 +0000 (13:02 -0500)
committerKefu Chai <kchai@redhat.com>
Wed, 15 Jan 2020 04:21:46 +0000 (12:21 +0800)
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>
src/os/bluestore/BlueFS.cc

index 26572052dfa46f803ca30d7ca52731b0d687e87d..1ace095ae3f74995ef44bdf8132d056ab299161a 100644 (file)
@@ -2240,7 +2240,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;
@@ -2316,6 +2315,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.