Commit cc23255e authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet
Browse files

bcachefs: Add a missing wakeup



This fixes a rare bug with bch2_btree_flush_all_writes() getting stuck.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent f6c92ebb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1622,6 +1622,8 @@ static void __btree_node_write_done(struct bch_fs *c, struct btree *b)

	if (new & (1U << BTREE_NODE_write_in_flight))
		__bch2_btree_node_write(c, b, BTREE_WRITE_ALREADY_STARTED);
	else
		wake_up_bit(&b->flags, BTREE_NODE_write_in_flight);
}

static void btree_node_write_done(struct bch_fs *c, struct btree *b)
@@ -2091,7 +2093,6 @@ static void __bch2_btree_flush_all(struct bch_fs *c, unsigned flag)
			rcu_read_unlock();
			wait_on_bit_io(&b->flags, flag, TASK_UNINTERRUPTIBLE);
			goto restart;

		}
	rcu_read_unlock();
}