diff options
author | Martin Wilck <mwilck@suse.com> | 2018-07-26 00:15:07 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-07-26 20:52:29 +0300 |
commit | b403ea2404889e1227812fa9657667a1deb9c694 (patch) | |
tree | bbe37dba31a278aaaa897261576248d51e5dc7ff /fs | |
parent | 78e18063a9696c508dc95581fb8ec1aee539c4ee (diff) | |
download | linux-b403ea2404889e1227812fa9657667a1deb9c694.tar.xz |
block: bio_iov_iter_get_pages: fix size of last iovec
If the last page of the bio is not "full", the length of the last
vector slot needs to be corrected. This slot has the index
(bio->bi_vcnt - 1), but only in bio->bi_io_vec. In the "bv" helper
array, which is shifted by the value of bio->bi_vcnt at function
invocation, the correct index is (nr_pages - 1).
v2: improved readability following suggestions from Ming Lei.
v3: followed a formatting suggestion from Christoph Hellwig.
Fixes: 2cefe4dbaadf ("block: add bio_iov_iter_get_pages()")
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions