summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-09-26 23:02:06 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:15 +0300
commitd2a990d1b132c8124a3856706f6b3663b9059bb5 (patch)
tree43b7cb07ab9e318e29b5129d9d867718fa9ed3f8 /fs/bcachefs/bcachefs.h
parenta190cbcfa029b7921cfda484e2a125649496941e (diff)
downloadlinux-d2a990d1b132c8124a3856706f6b3663b9059bb5.tar.xz
bcachefs: bch_err_msg(), bch_err_fn() now filters out transaction restart errors
These errors aren't actual errors, and should never be printed - do this in the common helpers. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index ad18f3b10af0..e9d07f9fa1c0 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -293,9 +293,17 @@ do { \
printk_ratelimited(KERN_ERR bch2_fmt_inum_offset(c, _inum, _offset, fmt), ##__VA_ARGS__)
#define bch_err_fn(_c, _ret) \
- bch_err(_c, "%s(): error %s", __func__, bch2_err_str(_ret))
+do { \
+ if (_ret && !bch2_err_matches(_ret, BCH_ERR_transaction_restart))\
+ bch_err(_c, "%s(): error %s", __func__, bch2_err_str(_ret));\
+} while (0)
+
#define bch_err_msg(_c, _ret, _msg, ...) \
- bch_err(_c, "%s(): error " _msg " %s", __func__, ##__VA_ARGS__, bch2_err_str(_ret))
+do { \
+ if (_ret && !bch2_err_matches(_ret, BCH_ERR_transaction_restart))\
+ bch_err(_c, "%s(): error " _msg " %s", __func__, \
+ ##__VA_ARGS__, bch2_err_str(_ret)); \
+} while (0)
#define bch_verbose(c, fmt, ...) \
do { \