diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-11-14 21:28:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-11-14 21:28:40 -0500 |
commit | 4fb361e5799e3cf3041661b00832ff644c53166a (patch) | |
tree | 44b32515cf1a4ef7012b48f898eeee35955dd9de | |
parent | 8ab7d6c37b496744c51e6f3e5cc7d7a9a44685f2 (diff) |
bcachefs: Delete backpointers check in try_alloc_bucket()
try_alloc_bucket() has a "safety" check, which avoids allocating a
bucket if there's any backpointers present.
But backpointers are not the source of truth for live data in a bucket,
the bucket sector counts are; this check was fairly useless, and we're
also deferring backpointers checks from fsck to runtime in the near
future.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/alloc_foreground.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index 955ea6ae868f..6d665b720f72 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -290,26 +290,6 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc if (ret) return NULL; - if (unlikely(c->curr_recovery_pass <= BCH_RECOVERY_PASS_check_extents_to_backpointers)) { - struct bch_backpointer bp; - struct bpos bp_pos = POS_MIN; - - ret = bch2_get_next_backpointer(trans, ca, POS(ca->dev_idx, b), -1, - &bp_pos, &bp, - BTREE_ITER_nopreserve); - if (ret) - return ERR_PTR(ret); - - if (!bkey_eq(bp_pos, POS_MAX)) { - /* - * Bucket may have data in it - we don't call - * bch2_trans_inconsistent() because fsck hasn't - * finished yet - */ - return NULL; - } - } - return __try_alloc_bucket(c, ca, b, gen, watermark, s, cl); } |