Btrfs: skip checksum when reading compressed data if some IO have failed
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 20 Sep 2017 23:50:19 +0000 (17:50 -0600)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Sep 2017 12:53:26 +0000 (14:53 +0200)
commite6311f240c946788131ba2b97e14f37312688072
treefdd78165cfdd0d426f7c0b86b28e910716d88821
parentcf1167d5c1abf3bc42b2a1562bfa7937c05337e2
Btrfs: skip checksum when reading compressed data if some IO have failed

Currently even if the underlying disk reports failure on IO,
compressed read endio still gets to verify checksum and reports it as
a checksum error.

In fact, if some IO have failed during reading a compressed data
extent , there's no way the checksum could match, therefore, we can
skip that in order to return error quickly to the upper layer.

Please note that we need to do this after recording the failed mirror
index so that read-repair in the upper layer's endio can work
properly.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Tested-by: Paul Jones <paul@pauljones.id.au>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c