btrfs: don't report readahead errors and don't update statistics
authorDavid Sterba <dsterba@suse.com>
Thu, 7 Mar 2019 14:40:50 +0000 (15:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:26:21 +0000 (06:26 +0200)
commitd952c337b25d3f3d3e4b2156b2ab83118c7951fd
tree8b343fc6f36b9a93d136fa1efb86e79e90b2cd28
parentb57220cc982033dc8e1e8d398cb006b72b275213
btrfs: don't report readahead errors and don't update statistics

commit 0cc068e6ee59c1fffbfa977d8bf868b7551d80ac upstream.

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 ("btrfs: readpages() should submit IO as read-ahead") 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
Reported-by: LimeTech <tomm@lime-technology.com>
Fixes: 5e9d398240b2 ("btrfs: readpages() should submit IO as read-ahead")
CC: stable@vger.kernel.org # 4.19+
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/volumes.c