diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-02-27 19:14:23 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:16 -0400 |
commit | 8db2acde2fca80954b4db12977182aa44b1e85fe (patch) | |
tree | 14813240f2719823a946b6bc62a755ae9ea22c01 /fs/bcachefs/journal.h | |
parent | 28062d320bded23eb7d24633e6ab11ea3c03487b (diff) | |
download | lwn-8db2acde2fca80954b4db12977182aa44b1e85fe.tar.gz lwn-8db2acde2fca80954b4db12977182aa44b1e85fe.zip |
bcachefs: fix integer underflow in journal code
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r-- | fs/bcachefs/journal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h index 4acb0f59396d..77d59fb0b151 100644 --- a/fs/bcachefs/journal.h +++ b/fs/bcachefs/journal.h @@ -292,6 +292,8 @@ static inline int journal_res_get_fast(struct journal *j, if (new.cur_entry_offset + res->u64s > j->cur_entry_u64s) return 0; + EBUG_ON(!journal_state_count(new, new.idx)); + if (flags & JOURNAL_RES_GET_CHECK) return 1; |