]> git.itanic.dy.fi Git - linux-stable/commit
bio: fix bio_copy_kern() handling of bio->bv_len
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Wed, 27 Aug 2008 22:25:47 +0000 (22:25 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 11:44:18 +0000 (04:44 -0700)
commitd53ff904c039b2bb6e9645ca276def571993e387
tree4bef7b7fd81350f4a5c002ce85b47c940b5c5771
parentb9db91ffefa1922e9d9fc1c5407b2fcfa13d16bc
bio: fix bio_copy_kern() handling of bio->bv_len

commit 76029ff37f31dad64641489c610d98955217bb68 upstream

The commit 68154e90c9d1492d570671ae181d9a8f8530da55 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>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/bio.c