[PATCH 0/4] block: fix bio_will_gap()

From: Ming Lei
Date: Mon Feb 15 2016 - 02:02:27 EST


Hi,

After bio splitting is introduced, the splitted bio can be fast-cloned,
which is correct because biovecs has become immutable since v3.13.

Unfortunately bio_will_gap() isn't ready for this kind of change,
because it figures out the last bvec via 'bi_io_vec[prev->bi_vcnt - 1]'
directly.

It is observed that lots of BIOs are merges even the virt boundary
limit is violated, and the issue is reported from Sagi Grimberg.

This patchset try to fix the issue by introducing two helpers for getting
the first and last bvec of one bio by the bio iterator helpers.

block/blk-merge.c | 8 ++------
include/linux/bio.h | 20 ++++++++++++++++++++
include/linux/blkdev.h | 11 ++++++++---
3 files changed, 30 insertions(+), 9 deletions(-)

Thanks,
Ming