diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-01-04 00:00:55 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:49 -0400 |
commit | 9fea089a9502784f42868b2649a732724f4c1d0b (patch) | |
tree | 21460c9512d117f3fffd32ae09401c461aa29d2f /fs/bcachefs/lru.c | |
parent | d7dd3fb84f05a0d221be3979929706a4828fb252 (diff) | |
download | lwn-9fea089a9502784f42868b2649a732724f4c1d0b.tar.gz lwn-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/lru.c')
-rw-r--r-- | fs/bcachefs/lru.c | 6 |
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; } |