提交 af3e3a52 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

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: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 3684aa70
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册