summaryrefslogtreecommitdiff
path: root/fs/bcachefs/lru.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-06-17 10:06:03 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-06-19 18:27:24 -0400
commitcff07e2739d81cf33eb2a378a6136eced852b8cb (patch)
tree16d13ed597b1558a6eeb6bd686acda0199d7f190 /fs/bcachefs/lru.h
parent1ba44217f8258f92c56644ca4fad4462f1941e33 (diff)
bcachefs: Guard against overflowing LRU_TIME_BITS
LRUs only have 48 bits for the time field (i.e. LRU order); thus we need overflow checks and guards. Reported-by: syzbot+df3bf3f088dcaa728857@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/lru.h')
-rw-r--r--fs/bcachefs/lru.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/bcachefs/lru.h b/fs/bcachefs/lru.h
index fb11ab0dd00e..bd71ba77de07 100644
--- a/fs/bcachefs/lru.h
+++ b/fs/bcachefs/lru.h
@@ -2,9 +2,6 @@
#ifndef _BCACHEFS_LRU_H
#define _BCACHEFS_LRU_H
-#define LRU_TIME_BITS 48
-#define LRU_TIME_MAX ((1ULL << LRU_TIME_BITS) - 1)
-
static inline u64 lru_pos_id(struct bpos pos)
{
return pos.inode >> LRU_TIME_BITS;