Skip to content

Commit f351d91

Browse files
author
Kent Overstreet
committed
bcachefs: Fix allocate -> self healing path
When we go to allocate and find taht a bucket in the freespace btree is actually allocated, we're supposed to return nonzero to tell the allocator to skip it. This fixes an emergency read only due to a bucket/ptr gen mismatch - we also don't return the correct bucket gen when this happens. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 016c4b4 commit f351d91

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/bcachefs/alloc_background.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,8 @@ int bch2_check_discard_freespace_key(struct btree_trans *trans, struct btree_ite
14751475
w->c = c;
14761476
w->pos = BBPOS(iter->btree_id, iter->pos);
14771477
queue_work(c->write_ref_wq, &w->work);
1478+
1479+
ret = 1; /* don't allocate from this bucket */
14781480
goto out;
14791481
}
14801482
}

0 commit comments

Comments
 (0)