block: fix blk_rq_append_bio
authorJens Axboe <axboe@kernel.dk>
Mon, 18 Dec 2017 07:40:44 +0000 (15:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2018 19:31:05 +0000 (20:31 +0100)
commit88da02868f7741cc7c1d895840e236e6df5483ef
tree33d80c2ff5a6d19377643b0378e552cceb4852a4
parent0c688c288f8e82fdb5f3e0d0f3b2b1f3498ad187
block: fix blk_rq_append_bio

commit 0abc2a10389f0c9070f76ca906c7382788036b93 upstream.

Commit caa4b02476e3(blk-map: call blk_queue_bounce from blk_rq_append_bio)
moves blk_queue_bounce() into blk_rq_append_bio(), but don't consider
the fact that the bounced bio becomes invisible to caller since the
parameter type is 'struct bio *'. Make it a pointer to a pointer to
a bio, so the caller sees the right bio also after a bounce.

Fixes: caa4b02476e3 ("blk-map: call blk_queue_bounce from blk_rq_append_bio")
Cc: Christoph Hellwig <hch@lst.de>
Reported-by: Michele Ballabio <barra_cuda@katamail.com>
(handling failure of blk_rq_append_bio(), only call bio_get() after
blk_rq_append_bio() returns OK)
Tested-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-map.c
drivers/scsi/osd/osd_initiator.c
drivers/target/target_core_pscsi.c
include/linux/blkdev.h