From 1bb3c2a9747c404d23012088fbefb4499b884415 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 20 Jun 2023 13:49:25 -0400 Subject: 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 --- fs/bcachefs/quota.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/bcachefs/quota.c') diff --git a/fs/bcachefs/quota.c b/fs/bcachefs/quota.c index d20ec9764108..7e1f1828ab20 100644 --- a/fs/bcachefs/quota.c +++ b/fs/bcachefs/quota.c @@ -621,10 +621,11 @@ int bch2_fs_quota_read(struct bch_fs *c) for_each_btree_key2(&trans, iter, BTREE_ID_inodes, POS_MIN, BTREE_ITER_PREFETCH|BTREE_ITER_ALL_SNAPSHOTS, k, bch2_fs_quota_read_inode(&trans, &iter, k)); - if (ret) - bch_err(c, "%s: err %s", __func__, bch2_err_str(ret)); bch2_trans_exit(&trans); + + if (ret) + bch_err_fn(c, ret); return ret; } -- cgit v1.2.3