btrfs: don't report readahead errors and don't update statistics
diff mbox series

Message ID
State New
Headers show
  • btrfs: don't report readahead errors and don't update statistics
Related show

Commit Message

David Sterba March 7, 2019, 2:55 p.m. UTC
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.

Reported-by: LimeTech <>
Fixes: 5e9d398240b2 ("btrfs: readpages() should submit IO as read-ahead")
CC: # 4.19+
Signed-off-by: David Sterba <>
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9024eee889b9..db934ceae9c1 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6407,7 +6407,7 @@  static void btrfs_end_bio(struct bio *bio)
 				if (bio_op(bio) == REQ_OP_WRITE)
-				else
+				else if (!(bio->bi_opf & REQ_RAHEAD))
 				if (bio->bi_opf & REQ_PREFLUSH)