diff options
author | Dave Airlie <airlied@redhat.com> | 2017-10-03 09:35:04 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-10-03 09:35:04 +1000 |
commit | ebec44a2456fbe5fe18aae88f6010f6878f0cb4a (patch) | |
tree | 427734722bdf3e807333329f33a6dbd6e95ec747 /fs/btrfs/compression.c | |
parent | 659333de48268550b5f09fcd45f76459d737b946 (diff) | |
parent | 9e66317d3c92ddaab330c125dfe9d06eee268aff (diff) | |
download | linux-ebec44a2456fbe5fe18aae88f6010f6878f0cb4a.tar.gz linux-ebec44a2456fbe5fe18aae88f6010f6878f0cb4a.tar.bz2 linux-ebec44a2456fbe5fe18aae88f6010f6878f0cb4a.zip |
BackMerge tag 'v4.14-rc3' into drm-next
Linux 4.14-rc3
Requested by Daniel for the tracing build fix in fixes.
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index b51d23f5cafa..280384bf34f1 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -107,7 +107,8 @@ static void end_compressed_bio_read(struct bio *bio) struct inode *inode; struct page *page; unsigned long index; - int ret; + unsigned int mirror = btrfs_io_bio(bio)->mirror_num; + int ret = 0; if (bio->bi_status) cb->errors = 1; @@ -118,6 +119,21 @@ static void end_compressed_bio_read(struct bio *bio) if (!refcount_dec_and_test(&cb->pending_bios)) goto out; + /* + * Record the correct mirror_num in cb->orig_bio so that + * read-repair can work properly. + */ + ASSERT(btrfs_io_bio(cb->orig_bio)); + btrfs_io_bio(cb->orig_bio)->mirror_num = mirror; + cb->mirror_num = mirror; + + /* + * Some IO in this cb have failed, just skip checksum as there + * is no way it could be correct. + */ + if (cb->errors == 1) + goto csum_failed; + inode = cb->inode; ret = check_compressed_csum(BTRFS_I(inode), cb, (u64)bio->bi_iter.bi_sector << 9); |