summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-05 13:44:18 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:30 -0400
commite1effd42a1cb40048002f594c12e823b5e33ed5d (patch)
tree24af42ba8fc1021eebfceb6896c14132d6edb635 /fs/bcachefs/recovery.c
parentafb6f7f61ba38f4d4d96e8d1bf5fb9e7809e6c10 (diff)
downloadlwn-e1effd42a1cb40048002f594c12e823b5e33ed5d.tar.gz
lwn-e1effd42a1cb40048002f594c12e823b5e33ed5d.zip
bcachefs: More improvements for alloc info checks
- Move checks for whether the device & bucket are valid from the .key_invalid method to bch2_check_alloc_key(). This is because .key_invalid() is called on keys that may no longer exist (post journal replay), which is a problem when removing/resizing devices. - We weren't checking the need_discard btree to ensure that every set bucket has a corresponding alloc key. This refactors the code for checking the freespace btree, so that it now checks both. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index f9215cc7cb09..1fe3e81eaa3d 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1237,7 +1237,7 @@ use_clean:
if (c->opts.fsck) {
bch_info(c, "checking need_discard and freespace btrees");
err = "error checking need_discard and freespace btrees";
- ret = bch2_check_alloc_info(c, true);
+ ret = bch2_check_alloc_info(c);
if (ret)
goto err;