bcachefs: fix check_extent_overbig() call
PATCH 1/1 bcachefs: fix check_extent_overbig() call
We can't access btree key values after a transaction commit.
Reported-by [email protected]
Signed-off-by Kent Overstreet <[email protected]>
--- fs/bcachefs/fsck.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/bcachefs/fsck.c +5 -2
@@ -1975,6 +1975,10 @@ static int check_extent(struct btree_trans *trans, struct btree_iter *iter, } } + ret =check_extent_overbig (trans, iter, k); +if (ret) + goto err; + ret =bch2_trans_commit (trans, res,NULL , BCH_TRANS_COMMIT_no_enospc);if (ret) goto err;
@@ -2021,8 +2025,7 @@ int bch2_check_extents(struct bch_fs *c) POS(BCACHEFS_ROOT_INO, 0), BTREE_ITER_prefetch|BTREE_ITER_all_snapshots, k, ({bch2_disk_reservation_put (c, &res); -check_extent (trans, &iter, k, &w, &s, &extent_ends, &res) ?: -check_extent_overbig (trans, &iter, k); +check_extent (trans, &iter, k, &w, &s, &extent_ends, &res); })) ?:check_i_sectors_notnested (trans, &w);
Signature · 1 line
2.50.0