Skip to contentSkip to conversation

btrfs: don't report readahead errors and don't update statistics

PATCH New David Sterba 1 participant 1 message Mar 7, 2019

Subsystems (2)
lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs: don't report readahead errors and don't update statistics

As readahead is an optimization, all errors are usually filtered out, but still properly handled when the real read call is done. The commit 5e9d398240b2 added REQ_RAHEAD to readpages() because that's only used for readahead (despite what one would expect from the callback name).

This causes a flood of messages and inflated read error stats, so skip reporting in case it's readahead.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202403

Fixes 5e9d398240b2 ("btrfs: readpages() should submit IO as read-ahead")
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/volumes.c +1 -1
index 9024eee889b9..db934ceae9c1 100644
@@ -6407,7 +6407,7 @@ static void btrfs_end_bio(struct bio *bio)
 				if (bio_op(bio) == REQ_OP_WRITE)
 					btrfs_dev_stat_inc_and_print(dev,
 						BTRFS_DEV_STAT_WRITE_ERRS);
-				else
+				else if (!(bio->bi_opf & REQ_RAHEAD))
 					btrfs_dev_stat_inc_and_print(dev,
 						BTRFS_DEV_STAT_READ_ERRS);
 				if (bio->bi_opf & REQ_PREFLUSH)
Signature · 1 line
2.20.1