diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-21 08:16:32 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-06 07:24:19 +0300 |
commit | 5e329145148d7e9fe5a07ecfc08682ef7334a4d1 (patch) | |
tree | c0cf7a1da966b5523219190956f520ad4ca18751 /fs/bcachefs/bcachefs_format.h | |
parent | c98d132ed1e37bb1c6b2ddbb50f9eae2283f0df6 (diff) | |
download | linux-5e329145148d7e9fe5a07ecfc08682ef7334a4d1.tar.xz |
bcachefs: Check journal entries for invalid keys in trans commit path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index c134da7d8194..2c09b40a15b9 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -2172,6 +2172,19 @@ enum { BCH_JSET_ENTRY_NR }; +static inline bool jset_entry_is_key(struct jset_entry *e) +{ + switch (e->type) { + case BCH_JSET_ENTRY_btree_keys: + case BCH_JSET_ENTRY_btree_root: + case BCH_JSET_ENTRY_overwrite: + case BCH_JSET_ENTRY_write_buffer_keys: + return true; + } + + return false; +} + /* * Journal sequence numbers can be blacklisted: bsets record the max sequence * number of all the journal entries they contain updates for, so that on |