summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/move.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/move.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/move.c')
-rw-r--r--fs/bcachefs/move.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index fd629136824b..37fb3784a2f9 100644
--- a/fs/bcachefs/move.c
+++ b/fs/bcachefs/move.c
@@ -690,7 +690,7 @@ int __bch2_evacuate_bucket(struct btree_trans *trans,
bch2_trans_iter_exit(trans, &iter);
if (ret) {
- bch_err(c, "%s: error looking up alloc key: %s", __func__, bch2_err_str(ret));
+ bch_err_msg(c, ret, "looking up alloc key");
goto err;
}
@@ -701,7 +701,7 @@ int __bch2_evacuate_bucket(struct btree_trans *trans,
ret = bch2_btree_write_buffer_flush(trans);
if (ret) {
- bch_err(c, "%s: error flushing btree write buffer: %s", __func__, bch2_err_str(ret));
+ bch_err_msg(c, ret, "flushing btree write buffer");
goto err;
}
@@ -904,7 +904,7 @@ next:
bch2_trans_exit(&trans);
if (ret)
- bch_err(c, "error in %s(): %s", __func__, bch2_err_str(ret));
+ bch_err_fn(c, ret);
bch2_btree_interior_updates_flush(c);
@@ -1029,6 +1029,8 @@ int bch2_scan_old_btree_nodes(struct bch_fs *c, struct bch_move_stats *stats)
mutex_unlock(&c->sb_lock);
}
+ if (ret)
+ bch_err_fn(c, ret);
return ret;
}