summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c7
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 {