]> git.baikalelectronics.ru Git - kernel.git/commit
bio: fix bio_copy_kern() handling of bio->bv_len
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Mon, 25 Aug 2008 18:36:08 +0000 (20:36 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 27 Aug 2008 07:50:19 +0000 (09:50 +0200)
commitc4a2a4b6b929c73b4483438e1ac662d28fe9164f
treee8f729fa6288676be357295141a0950f171a62d8
parent12f7736732dfe478a8a5b2549d15c5eb15184fe1
bio: fix bio_copy_kern() handling of bio->bv_len

The commit 77625b77ddb8b1df707c0d8a14f5964287636788 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: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reported-by: Nix <nix@esperi.org.uk>
Tested-by: Nix <nix@esperi.org.uk>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/bio.c