diff options
author | Christoph Hellwig | 2016-03-11 17:34:50 +0100 |
---|---|---|
committer | Jens Axboe | 2016-03-14 15:55:21 +0100 |
commit | af3e3a5259e35d7056fbe568a0ffcbd1420e1742 (patch) | |
tree | a6d55bcb5428401bc0d0b93f250eee620a7d3185 /block | |
parent | block-dev: enable writeback cgroup support (diff) | |
download | kernel-qcow2-linux-af3e3a5259e35d7056fbe568a0ffcbd1420e1742.tar.gz kernel-qcow2-linux-af3e3a5259e35d7056fbe568a0ffcbd1420e1742.tar.xz kernel-qcow2-linux-af3e3a5259e35d7056fbe568a0ffcbd1420e1742.zip |
block: don't unecessarily clobber bi_error for chained bios
Only overwrite the parents bi_error if it was zero. That way a successful
bio completion doesn't reset the error pointer.
Reported-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/bio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/block/bio.c b/block/bio.c index dbabd48b1934..282ca2e5aaf2 100644 --- a/block/bio.c +++ b/block/bio.c @@ -300,7 +300,8 @@ static void bio_chain_endio(struct bio *bio) { struct bio *parent = bio->bi_private; - parent->bi_error = bio->bi_error; + if (!parent->bi_error) + parent->bi_error = bio->bi_error; bio_endio(parent); bio_put(bio); } @@ -1753,7 +1754,9 @@ void bio_endio(struct bio *bio) */ if (bio->bi_end_io == bio_chain_endio) { struct bio *parent = bio->bi_private; - parent->bi_error = bio->bi_error; + + if (!parent->bi_error) + parent->bi_error = bio->bi_error; bio_put(bio); bio = parent; } else { |