bcachefs: Add a race_fault() for write buffer slowpath
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 12 Jul 2023 15:43:03 +0000 (11:43 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:07 +0000 (17:10 -0400)
We haven't hooked up dynamic fault injection quite yet, but we will soon

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_write_buffer.c

index b502263..6c30a72 100644 (file)
@@ -129,6 +129,9 @@ int __bch2_btree_write_buffer_flush(struct btree_trans *trans, unsigned commit_f
        keys = wb->keys[s.idx];
        nr = s.nr;
 
+       if (race_fault())
+               goto slowpath;
+
        /*
         * We first sort so that we can detect and skip redundant updates, and
         * then we attempt to flush in sorted btree order, as this is most