Skip to content

Commit 7dfd42a

Browse files
author
Kent Overstreet
committed
bcachefs: Don't print data read retry success on non-errors
We may end up in the data read retry path when reading cached data and racing with invalidation, or on checksum error when we were reading into a userspace buffer that might have been modified while the read was in flight. These aren't real errors, so we shouldn't print the 'retry success' message. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 806776a commit 7dfd42a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/bcachefs/io_read.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ static void bch2_rbio_retry(struct work_struct *work)
487487
.inum = rbio->read_pos.inode,
488488
};
489489
struct bch_io_failures failed = { .nr = 0 };
490+
int orig_error = rbio->ret;
491+
490492
struct btree_trans *trans = bch2_trans_get(c);
491493

492494
trace_io_read_retry(&rbio->bio);
@@ -519,7 +521,9 @@ static void bch2_rbio_retry(struct work_struct *work)
519521
if (ret) {
520522
rbio->ret = ret;
521523
rbio->bio.bi_status = BLK_STS_IOERR;
522-
} else {
524+
} else if (orig_error != -BCH_ERR_data_read_retry_csum_err_maybe_userspace &&
525+
orig_error != -BCH_ERR_data_read_ptr_stale_race &&
526+
!failed.nr) {
523527
struct printbuf buf = PRINTBUF;
524528

525529
lockrestart_do(trans,

0 commit comments

Comments
 (0)