diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-10-12 11:02:50 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-10-12 11:02:50 +0200 |
commit | 331b57d14829c49d75076779cdc54d7e4537bbf0 (patch) | |
tree | 79a70eadb04ed2fd65d3280021ec6ad5266d1cc1 /fs/btrfs/compression.c | |
parent | x86/apic: Fix spelling mistake: "symmectic" -> "symmetric" (diff) | |
parent | genirq/cpuhotplug: Enforce affinity setting on startup of managed irqs (diff) | |
download | linux-331b57d14829c49d75076779cdc54d7e4537bbf0.tar.xz linux-331b57d14829c49d75076779cdc54d7e4537bbf0.zip |
Merge branch 'irq/urgent' into x86/apic
Pick up core changes which affect the vector rework.
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); |