Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore/bluefs: Fix false collision with lockdep module #43589

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/os/bluestore/BlueFS.cc
Expand Up @@ -2437,16 +2437,16 @@ void BlueFS::_compact_log_async_LD_NF_D() //also locks FW for new_writer
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

Expand Down Expand Up @@ -3184,9 +3184,9 @@ int BlueFS::truncate(FileWriter *h, uint64_t offset)

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)
Expand Down
12 changes: 6 additions & 6 deletions src/os/bluestore/BlueFS.h
Expand Up @@ -703,13 +703,13 @@ class FitToFastVolumeSelector : public OriginalVolumeSelector {
* 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.
*/
Expand Down