diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-01-20 23:31:31 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:51 +0200 |
commit | a5cd80ea99e544b67acde573fc2a2dd68659fd40 (patch) | |
tree | fb36475ff94e9e3269b2ba824170b21887eab991 /fs | |
parent | bcachefs: Don't allocate stripes at POS_MIN (diff) | |
download | linux-a5cd80ea99e544b67acde573fc2a2dd68659fd40.tar.xz linux-a5cd80ea99e544b67acde573fc2a2dd68659fd40.zip |
bcachefs: Fix an assertion pop
There was a race: btree node writes drop their reference on journal pins
before clearing the btree_node_write_in_flight flag.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r-- | fs/bcachefs/btree_io.c | 17 | ||||
-rw-r--r-- | fs/bcachefs/btree_io.h | 1 | ||||
-rw-r--r-- | fs/bcachefs/super.c | 5 |
3 files changed, 1 insertions, 22 deletions
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c index c4d53ea2e920..cd2b300043b6 100644 --- a/fs/bcachefs/btree_io.c +++ b/fs/bcachefs/btree_io.c @@ -1829,23 +1829,6 @@ void bch2_btree_flush_all_writes(struct bch_fs *c) __bch2_btree_flush_all(c, BTREE_NODE_write_in_flight); } -void bch2_btree_verify_flushed(struct bch_fs *c) -{ - struct bucket_table *tbl; - struct rhash_head *pos; - struct btree *b; - unsigned i; - - rcu_read_lock(); - for_each_cached_btree(b, c, tbl, i, pos) { - unsigned long flags = READ_ONCE(b->flags); - - BUG_ON((flags & (1 << BTREE_NODE_dirty)) || - (flags & (1 << BTREE_NODE_write_in_flight))); - } - rcu_read_unlock(); -} - void bch2_dirty_btree_nodes_to_text(struct printbuf *out, struct bch_fs *c) { struct bucket_table *tbl; diff --git a/fs/bcachefs/btree_io.h b/fs/bcachefs/btree_io.h index 1a4b11e99cc4..3b61555ef906 100644 --- a/fs/bcachefs/btree_io.h +++ b/fs/bcachefs/btree_io.h @@ -185,7 +185,6 @@ do { \ void bch2_btree_flush_all_reads(struct bch_fs *); void bch2_btree_flush_all_writes(struct bch_fs *); -void bch2_btree_verify_flushed(struct bch_fs *); void bch2_dirty_btree_nodes_to_text(struct printbuf *, struct bch_fs *); static inline void compat_bformat(unsigned level, enum btree_id btree_id, diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index f46b4b05b4aa..2b3fb07fbc4d 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -242,10 +242,7 @@ nowrote_alloc: * the journal kicks off btree writes via reclaim - wait for in flight * writes after stopping journal: */ - if (test_bit(BCH_FS_EMERGENCY_RO, &c->flags)) - bch2_btree_flush_all_writes(c); - else - bch2_btree_verify_flushed(c); + bch2_btree_flush_all_writes(c); /* * After stopping journal: |