mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
bcachefs: avoid overflowing LRU_TIME_BITS for cached data lru
Reported-by: syzbot+510b0b28f8e6de64d307@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
075cabf324
commit
9482f3b053
1 changed files with 3 additions and 1 deletions
|
@ -150,7 +150,9 @@ static inline void alloc_data_type_set(struct bch_alloc_v4 *a, enum bch_data_typ
|
|||
|
||||
static inline u64 alloc_lru_idx_read(struct bch_alloc_v4 a)
|
||||
{
|
||||
return a.data_type == BCH_DATA_cached ? a.io_time[READ] : 0;
|
||||
return a.data_type == BCH_DATA_cached
|
||||
? a.io_time[READ] & LRU_TIME_MAX
|
||||
: 0;
|
||||
}
|
||||
|
||||
#define DATA_TYPES_MOVABLE \
|
||||
|
|
Loading…
Reference in a new issue