On 07/19/2018 11:39 AM, Martin Wilck wrote: > 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. > > Fixes: 2cefe4dbaadf ("block: add bio_iov_iter_get_pages()") > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> > --- > block/bio.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)