diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-05 13:44:18 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-05-30 18:17:19 -0400 |
commit | 6cdaa89ff1b907fb87f9ae37d0f50d56faa866da (patch) | |
tree | 9776209c1177215c52eb77b84717e103c0b70a9d /fs/bcachefs/recovery.c | |
parent | d0e9a6b3da058aa27dae74348cda985306d06fba (diff) |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 99b7b2b26573..88ed803021ba 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; |