new_log_writer = _create_writer(new_log);
new_log_writer->append(bl);
- new_log->lock.lock();
new_log_writer->lock.lock();
+ new_log->lock.lock();
// 3. flush
r = _flush_special(new_log_writer);
ceph_assert(r == 0);
// 4. wait
_flush_bdev(new_log_writer);
- new_log_writer->lock.unlock();
new_log->lock.unlock();
+ new_log_writer->lock.unlock();
// 5. update our log fnode
// discard first old_log_jump_to extents
int BlueFS::fsync(FileWriter *h)
{
- std::unique_lock hl(h->lock);
uint64_t old_dirty_seq = 0;
{
+ std::unique_lock hl(h->lock);
dout(10) << __func__ << " " << h << " " << h->file->fnode << dendl;
int r = _flush_F(h, true);
if (r < 0)
* Column represents last lock taken.
* Row represents next lock taken.
*
- * < | L | D | N | F | W
+ * > | W | L | D | N | F
* -------------|---|---|---|---|---
- * log L | < <
- * dirty D |
- * nodes N | <
- * File F |
- * FileWriter W | < < <
+ * FileWriter W | | > | > | | >
+ * log L | | > | > | >
+ * dirty D | | | >
+ * nodes N | | >
+ * File F |
*
* Claim: Deadlock is possible IFF graph contains cycles.
*/