diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-10 15:47:46 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:52 -0400 |
commit | 12795a1937460020af999e3cf54c146598402455 (patch) | |
tree | ae1869f0095a335873114b3cbc40347e6326bcbc /fs/bcachefs/btree_io.c | |
parent | 637de729fc86effe021bd067cccd68efd07f59c0 (diff) | |
download | linux-12795a1937460020af999e3cf54c146598402455.tar.gz linux-12795a1937460020af999e3cf54c146598402455.tar.bz2 linux-12795a1937460020af999e3cf54c146598402455.zip |
bcachefs: Add some logging for btree node rewrites due to errors
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_io.c')
-rw-r--r-- | fs/bcachefs/btree_io.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c index 87d80a59dd7e..66747fe21323 100644 --- a/fs/bcachefs/btree_io.c +++ b/fs/bcachefs/btree_io.c @@ -1240,8 +1240,16 @@ start: bio_put(&rb->bio); printbuf_exit(&buf); - if (saw_error && !btree_node_read_error(b)) + if (saw_error && !btree_node_read_error(b)) { + struct printbuf buf = PRINTBUF; + + bch2_bpos_to_text(&buf, b->key.k.p); + bch_info(c, "%s: rewriting btree node at btree=%s level=%u %s due to error", + __func__, bch2_btree_ids[b->c.btree_id], b->c.level, buf.buf); + printbuf_exit(&buf); + bch2_btree_node_rewrite_async(c, b); + } clear_btree_node_read_in_flight(b); wake_up_bit(&b->flags, BTREE_NODE_read_in_flight); |