bcachefs: Write buffer flush needs BTREE_INSERT_NOCHECK_RW
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 11 Jun 2023 23:45:21 +0000 (19:45 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:04 +0000 (17:10 -0400)
btree write buffer flush is only invoked from contexts that already hold
a write ref, and checking if we're still RW could cause us to fail to
completely flush the write buffer when shutting down.

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

index 9983a47853b91b66b3e466990a573eddb0b22bb6..88c4b50dd70fa0987e19fbf9fe8e33cf897e6d79 100644 (file)
@@ -78,6 +78,7 @@ trans_commit:
        return  bch2_trans_update(trans, iter, &wb->k, 0) ?:
                bch2_trans_commit(trans, NULL, NULL,
                                  commit_flags|
+                                 BTREE_INSERT_NOCHECK_RW|
                                  BTREE_INSERT_NOFAIL|
                                  BTREE_INSERT_JOURNAL_RECLAIM);
 }