summaryrefslogtreecommitdiff
path: root/libbcachefs/error.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-13 19:14:01 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-03-13 19:20:59 -0400
commitd34e731082d8fcd710c2af6377a3b7fa927c8451 (patch)
tree96a9a25295fcb570358e30ae04a16b2c7a7f7aa3 /libbcachefs/error.h
parentbf7924f5526707e01213cad546794571764bc177 (diff)
Update bcachefs sources to e48731a188 bcachefs: Fix BTREE_TRIGGER_WANTS_OLD_AND_NEW
Diffstat (limited to 'libbcachefs/error.h')
-rw-r--r--libbcachefs/error.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libbcachefs/error.h b/libbcachefs/error.h
index 4ab3cfe1..6e63c381 100644
--- a/libbcachefs/error.h
+++ b/libbcachefs/error.h
@@ -67,6 +67,26 @@ do { \
})
/*
+ * When a transaction update discovers or is causing a fs inconsistency, it's
+ * helpful to also dump the pending updates:
+ */
+#define bch2_trans_inconsistent(trans, ...) \
+({ \
+ bch_err(trans->c, __VA_ARGS__); \
+ bch2_inconsistent_error(trans->c); \
+ bch2_dump_trans_updates(trans); \
+})
+
+#define bch2_trans_inconsistent_on(cond, trans, ...) \
+({ \
+ bool _ret = unlikely(!!(cond)); \
+ \
+ if (_ret) \
+ bch2_trans_inconsistent(trans, __VA_ARGS__); \
+ _ret; \
+})
+
+/*
* Fsck errors: inconsistency errors we detect at mount time, and should ideally
* be able to repair:
*/