Skip to content

Commit 72e71bf

Browse files
author
Kent Overstreet
committed
bcachefs: Fix a scheduler splat in __bch2_next_write_buffer_flush_journal_buf()
We're using mutex_lock() inside a wait_event() conditional - prepare_to_wait() has already flipped task state, so potentially blocking ops need annotation. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent c258c08 commit 72e71bf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/bcachefs/journal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,8 @@ static struct journal_buf *__bch2_next_write_buffer_flush_journal_buf(struct jou
870870
{
871871
struct journal_buf *ret = NULL;
872872

873+
/* We're inside wait_event(), but using mutex_lock(: */
874+
sched_annotate_sleep();
873875
mutex_lock(&j->buf_lock);
874876
spin_lock(&j->lock);
875877
max_seq = min(max_seq, journal_cur_seq(j));

0 commit comments

Comments
 (0)