mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
Merge pull request #14489 from liewegas/wip-bluestore-fix-flush
os/bluestore: fix narrow osr->flush() race
This commit is contained in:
commit
08d3fa490f
@ -1655,10 +1655,13 @@ public:
|
||||
void flush() override {
|
||||
std::unique_lock<std::mutex> l(qlock);
|
||||
while (true) {
|
||||
// set flag before the check because the condition
|
||||
// may become true outside qlock, and we need to make
|
||||
// sure those threads see waiters and signal qcond.
|
||||
++kv_submitted_waiters;
|
||||
if (_is_all_kv_submitted()) {
|
||||
return;
|
||||
}
|
||||
++kv_submitted_waiters;
|
||||
qcond.wait(l);
|
||||
--kv_submitted_waiters;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user