mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-18 00:24:39 +00:00
bcachefs: Fix an assertion
If we're invalidating a bucket that has cached data in it, data_type won't be 0 - oops. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
bfcf840ddf
commit
4529ae09ce
1 changed files with 2 additions and 1 deletions
|
@ -887,7 +887,7 @@ static int bch2_invalidate_one_bucket2(struct btree_trans *trans,
|
|||
g = bucket(ca, b);
|
||||
m = READ_ONCE(g->mark);
|
||||
|
||||
BUG_ON(m.data_type || m.dirty_sectors);
|
||||
BUG_ON(m.dirty_sectors);
|
||||
|
||||
bch2_mark_alloc_bucket(c, ca, b, true, gc_pos_alloc(c, NULL), 0);
|
||||
|
||||
|
@ -903,6 +903,7 @@ static int bch2_invalidate_one_bucket2(struct btree_trans *trans,
|
|||
*/
|
||||
if (!m.cached_sectors &&
|
||||
!bucket_needs_journal_commit(m, c->journal.last_seq_ondisk)) {
|
||||
BUG_ON(m.data_type);
|
||||
bucket_cmpxchg(g, m, m.gen++);
|
||||
percpu_up_read(&c->mark_lock);
|
||||
goto out;
|
||||
|
|
Loading…
Reference in a new issue