bcachefs: Add a missing wakeup
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 10 Mar 2022 22:35:06 +0000 (17:35 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:27 +0000 (17:09 -0400)
This fixes a rare bug with bch2_btree_flush_all_writes() getting stuck.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_io.c

index 3031b566a112b3f14f4e524e5f58d2add06144c8..887a1b145cdc898dc5478002bee0beb587bfb02f 100644 (file)
@@ -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 @@ restart:
                        rcu_read_unlock();
                        wait_on_bit_io(&b->flags, flag, TASK_UNINTERRUPTIBLE);
                        goto restart;
-
                }
        rcu_read_unlock();
 }