summaryrefslogtreecommitdiff
path: root/fs/bcachefs/error.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-12-03 20:29:09 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-02-18 21:14:59 -0500
commitb28b848e8b8041908525b1ff837f0fc274633cb1 (patch)
tree207f118ef1a5974c15b3af02477fde5ffb16c89b /fs/bcachefs/error.h
parent640c2782d855d237bfe3df5443f0e611d4ae1fee (diff)
error handlingbcachefs_disk_groups
Diffstat (limited to 'fs/bcachefs/error.h')
-rw-r--r--fs/bcachefs/error.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/bcachefs/error.h b/fs/bcachefs/error.h
index ac3e96d2ae43..d59e95eb72d5 100644
--- a/fs/bcachefs/error.h
+++ b/fs/bcachefs/error.h
@@ -16,23 +16,24 @@ struct work_struct;
/*
* Very fatal logic/inconsistency errors: these indicate that we've majorly
- * screwed up at runtime, i.e. it's not likely that it was just caused by the
- * data on disk being inconsistent. These BUG():
- *
- * XXX: audit and convert to inconsistent() checks
+ * screwed up at runtime, and we _must_ at least go RO
*/
+void __bch2_fs_bug(struct bch_fs *);
#define bch2_fs_bug(c, ...) \
do { \
bch_err(c, __VA_ARGS__); \
- BUG(); \
+ __bch2_fs_bug(c); \
} while (0)
#define bch2_fs_bug_on(cond, c, ...) \
-do { \
- if (cond) \
+({ \
+ int _ret = !!(cond); \
+ \
+ if (_ret) \
bch2_fs_bug(c, __VA_ARGS__); \
-} while (0)
+ _ret; \
+})
/*
* Inconsistency errors: The on disk data is inconsistent. If these occur during