diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-01-03 23:54:10 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:52 -0400 |
commit | 629a21b621c466deac6e7ce20242308091f09735 (patch) | |
tree | b91390439357a9b087cc49ea65f03d95701464cf /fs/bcachefs/lru.c | |
parent | 46eea9cb9ec14684d1b6e90c17db1ac896f26a5b (diff) | |
download | lwn-629a21b621c466deac6e7ce20242308091f09735.tar.gz lwn-629a21b621c466deac6e7ce20242308091f09735.zip |
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/lru.c')
-rw-r--r-- | fs/bcachefs/lru.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |