diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-05 21:03:57 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:49 -0400 |
commit | f51e84fe24d8d170bfbba626e76ee08b1ab7b283 (patch) | |
tree | ecef2e025336fd350113b49044ccb3eed6c198e8 /fs/bcachefs/journal_reclaim.c | |
parent | 5d32c5bb076e76232e56fd44c537046abd54d32c (diff) | |
download | linux-f51e84fe24d8d170bfbba626e76ee08b1ab7b283.tar.gz linux-f51e84fe24d8d170bfbba626e76ee08b1ab7b283.tar.bz2 linux-f51e84fe24d8d170bfbba626e76ee08b1ab7b283.zip |
bcachefs: Fix btree key cache dirty checks
Had a type that meant we were triggering journal reclaim _much_ more
aggressively than needed. Also, fix a potential integer overflow.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.c')
-rw-r--r-- | fs/bcachefs/journal_reclaim.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index 0fba832d3670..5ab147e94167 100644 --- a/fs/bcachefs/journal_reclaim.c +++ b/fs/bcachefs/journal_reclaim.c @@ -240,6 +240,7 @@ void bch2_journal_space_available(struct journal *j) u64s_remaining -= (u64) total << 3; u64s_remaining = max(0LL, u64s_remaining); u64s_remaining /= 2; + u64s_remaining = min_t(u64, u64s_remaining, U32_MAX); out: j->cur_entry_sectors = !ret ? j->space[journal_space_discarded].next_entry : 0; j->cur_entry_error = ret; |