From 629a21b621c466deac6e7ce20242308091f09735 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 3 Jan 2023 23:54:10 -0500 Subject: bcachefs: Improve invalidate_one_bucket() error messages Make sure to check for lru entries that point to buckets that don't exist as well as buckets in the wrong state, and improve the error message we print out. Signed-off-by: Kent Overstreet --- fs/bcachefs/lru.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fs/bcachefs/lru.c') diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c index f1d6368dda07..07fb41ca8c6b 100644 --- a/fs/bcachefs/lru.c +++ b/fs/bcachefs/lru.c @@ -37,6 +37,15 @@ void bch2_lru_to_text(struct printbuf *out, struct bch_fs *c, prt_printf(out, "idx %llu", le64_to_cpu(lru->idx)); } +void bch2_lru_pos_to_text(struct printbuf *out, struct bpos lru) +{ + prt_printf(out, "%llu:%llu -> %llu:%llu", + lru_pos_id(lru), + lru_pos_time(lru), + u64_to_bucket(lru.offset).inode, + u64_to_bucket(lru.offset).offset); +} + static int __bch2_lru_set(struct btree_trans *trans, u16 lru_id, u64 dev_bucket, u64 time, unsigned key_type) { -- cgit v1.2.3