diff options
author | 2025-04-09 21:04:17 -0400 | |
---|---|---|
committer | 2025-04-13 10:17:00 -0400 | |
commit | 7dfd42a07acfeaac4e36620927ea227b1e8da3e9 (patch) | |
tree | 5593a183db8970ccd2837222cdf0766b542173a6 | |
parent | bcachefs: Add missing error handling (diff) | |
download | wireguard-linux-7dfd42a07acfeaac4e36620927ea227b1e8da3e9.tar.xz wireguard-linux-7dfd42a07acfeaac4e36620927ea227b1e8da3e9.zip |
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 <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/io_read.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c index fd627c8d1053..de8ccd593ec7 100644 --- a/fs/bcachefs/io_read.c +++ b/fs/bcachefs/io_read.c @@ -487,6 +487,8 @@ static void bch2_rbio_retry(struct work_struct *work) .inum = rbio->read_pos.inode, }; struct bch_io_failures failed = { .nr = 0 }; + int orig_error = rbio->ret; + struct btree_trans *trans = bch2_trans_get(c); trace_io_read_retry(&rbio->bio); @@ -519,7 +521,9 @@ static void bch2_rbio_retry(struct work_struct *work) if (ret) { rbio->ret = ret; rbio->bio.bi_status = BLK_STS_IOERR; - } else { + } else if (orig_error != -BCH_ERR_data_read_retry_csum_err_maybe_userspace && + orig_error != -BCH_ERR_data_read_ptr_stale_race && + !failed.nr) { struct printbuf buf = PRINTBUF; lockrestart_do(trans, |