Skip to content

Commit

Permalink
bio_copy_user_iov(): don't ignore ->iov_offset
Browse files Browse the repository at this point in the history
Since "block: support large requests in blk_rq_map_user_iov" we
started to call it with partially drained iter; that works fine
on the write side, but reads create a copy of iter for completion
time.  And that needs to take the possibility of ->iov_iter != 0
into account...

Cc: stable@vger.kernel.org #v4.5+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 11, 2017
1 parent 2b04e8f commit 1cfd0dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,8 +1239,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
*/
bmd->is_our_pages = map_data ? 0 : 1;
memcpy(bmd->iov, iter->iov, sizeof(struct iovec) * iter->nr_segs);
iov_iter_init(&bmd->iter, iter->type, bmd->iov,
iter->nr_segs, iter->count);
bmd->iter = *iter;
bmd->iter.iov = bmd->iov;

ret = -ENOMEM;
bio = bio_kmalloc(gfp_mask, nr_pages);
Expand Down

0 comments on commit 1cfd0dd

Please sign in to comment.