summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-01-04 00:00:55 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:49 -0400
commit9fea089a9502784f42868b2649a732724f4c1d0b (patch)
tree21460c9512d117f3fffd32ae09401c461aa29d2f /fs/bcachefs
parentd7dd3fb84f05a0d221be3979929706a4828fb252 (diff)
downloadlinux-stable-9fea089a9502784f42868b2649a732724f4c1d0b.tar.gz
linux-stable-9fea089a9502784f42868b2649a732724f4c1d0b.tar.bz2
linux-stable-9fea089a9502784f42868b2649a732724f4c1d0b.zip
bcachefs: Check for lru entries with time=0
These are invalid. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/lru.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c
index e16686b3b45a..9b4ce27d12f3 100644
--- a/fs/bcachefs/lru.c
+++ b/fs/bcachefs/lru.c
@@ -19,6 +19,12 @@ int bch2_lru_invalid(const struct bch_fs *c, struct bkey_s_c k,
return -BCH_ERR_invalid_bkey;
}
+ if (!k.k->p.offset) {
+ prt_printf(err, "lru entry at time=0");
+ return -BCH_ERR_invalid_bkey;
+
+ }
+
return 0;
}