summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/backpointers.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-20 19:49:25 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:10:04 +0200
commit1bb3c2a9747c404d23012088fbefb4499b884415 (patch)
tree450da8adf0cea75a7dda044f4c4b7c3d413c9da0 /fs/bcachefs/backpointers.c
parentbcachefs: fiemap: Fix a lockdep splat (diff)
downloadlinux-1bb3c2a9747c404d23012088fbefb4499b884415.tar.xz
linux-1bb3c2a9747c404d23012088fbefb4499b884415.zip
bcachefs: New error message helpers
Add two new helpers for printing error messages with __func__ and bch2_err_str(): - bch_err_fn - bch_err_msg Also kill the old error strings in the recovery path, which were causing us to incorrectly report memory allocation failures - they're not needed anymore. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/backpointers.c')
-rw-r--r--fs/bcachefs/backpointers.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c
index 11201064d9a4..2641ebef6ae4 100644
--- a/fs/bcachefs/backpointers.c
+++ b/fs/bcachefs/backpointers.c
@@ -404,12 +404,16 @@ int bch2_check_btree_backpointers(struct bch_fs *c)
{
struct btree_iter iter;
struct bkey_s_c k;
+ int ret;
- return bch2_trans_run(c,
+ ret = bch2_trans_run(c,
for_each_btree_key_commit(&trans, iter,
BTREE_ID_backpointers, POS_MIN, 0, k,
NULL, NULL, BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL,
bch2_check_btree_backpointer(&trans, &iter, k)));
+ if (ret)
+ bch_err_fn(c, ret);
+ return ret;
}
struct bpos_level {
@@ -769,6 +773,8 @@ int bch2_check_extents_to_backpointers(struct bch_fs *c)
}
bch2_trans_exit(&trans);
+ if (ret)
+ bch_err_fn(c, ret);
return ret;
}
@@ -872,5 +878,7 @@ int bch2_check_backpointers_to_extents(struct bch_fs *c)
}
bch2_trans_exit(&trans);
+ if (ret)
+ bch_err_fn(c, ret);
return ret;
}