Skip to content
Commit 76029ff3 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Jens Axboe
Browse files

bio: fix bio_copy_kern() handling of bio->bv_len

The commit 68154e90

 introduced
bio_copy_kern() to add bounce support to blk_rq_map_kern.

bio_copy_kern() uses bio->bv_len to copy data for READ commands after
the completion but it doesn't work with a request that partially
completed. SCSI always completes a PC request as a whole but seems
some don't.

This patch fixes bio_copy_kern to handle the above case. As
bio_copy_user does, bio_copy_kern uses struct bio_map_data to store
struct bio_vec.

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reported-by: default avatarNix <nix@esperi.org.uk>
Tested-by: default avatarNix <nix@esperi.org.uk>
Cc: stable@kernel.org
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 48fd4f93
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment