]> git.baikalelectronics.ru Git - kernel.git/commit
block: bounce: make sure that bvec table is updated
authorMing Lei <ming.lei@redhat.com>
Thu, 21 Feb 2019 15:43:36 +0000 (23:43 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Feb 2019 17:58:44 +0000 (10:58 -0700)
commitfca441b3cfda3c58c2b2adab14c046263b1d91dc
tree15a75d174ed2de167fc9d8ef8802f2545be8b580
parentb350e9e4fa5d714c7cde508b0c57aa1fb206b769
block: bounce: make sure that bvec table is updated

Block bounce needs to allocate new page for doing IO, and the
new page has to be updated to bvec table.

Commit b3e229b9d switches __blk_queue_bounce() to use the new
bio_for_each_segment_all() interface. Unfortunately the new
bio_for_each_segment_all() can't be used to update bvec table.

This patch fixes this issue by retrieving bvec from the table
directly, then the new allocated page can be updated to the bio.
This way is safe because the cloned bio is single page bvec.

Fixes: b3e229b9d ("block: allow bio_for_each_segment_all() to iterate over multi-page bvec")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bounce.c