summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-03-08 18:42:34 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-16 13:47:55 -0400
commitccba9029b01cdcc1aa6f3ed6375efdc0d779cc8f (patch)
treeec1ac7668133384f3ef1747c59a34387a8fa3f74
parentde73677ff8e677bf84a0eefa17b3913f65b57a74 (diff)
bcachefs: Print message on successful read retry
Users have been asking for this, and now that errors are returned to the top level read retry path - we can. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/io_read.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c
index e54103f79323..887e3c9ac181 100644
--- a/fs/bcachefs/io_read.c
+++ b/fs/bcachefs/io_read.c
@@ -494,6 +494,9 @@ static void bch2_rbio_retry(struct work_struct *work)
rbio->ret = 0;
}
+ unsigned subvol = rbio->subvol;
+ struct bpos read_pos = rbio->read_pos;
+
rbio = bch2_rbio_free(rbio);
flags |= BCH_READ_in_retry;
@@ -508,6 +511,19 @@ static void bch2_rbio_retry(struct work_struct *work)
if (ret) {
rbio->ret = ret;
rbio->bio.bi_status = BLK_STS_IOERR;
+ } else {
+ struct printbuf buf = PRINTBUF;
+
+ bch2_trans_do(c,
+ bch2_inum_offset_err_msg_trans(trans, &buf,
+ (subvol_inum) { subvol, read_pos.inode },
+ read_pos.offset << 9));
+ if (rbio->flags & BCH_READ_data_update)
+ prt_str(&buf, "(internal move) ");
+ prt_str(&buf, "successful retry");
+
+ bch_err_ratelimited(c, "%s", buf.buf);
+ printbuf_exit(&buf);
}
bch2_rbio_done(rbio);