Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af3e3a52 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 3684aa70
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -300,6 +300,7 @@ static void bio_chain_endio(struct bio *bio)
{
	struct bio *parent = bio->bi_private;

	if (!parent->bi_error)
		parent->bi_error = bio->bi_error;
	bio_endio(parent);
	bio_put(bio);
@@ -1753,6 +1754,8 @@ void bio_endio(struct bio *bio)
		 */
		if (bio->bi_end_io == bio_chain_endio) {
			struct bio *parent = bio->bi_private;

			if (!parent->bi_error)
				parent->bi_error = bio->bi_error;
			bio_put(bio);
			bio = parent;