blk_recalc_rq_segments assumes that any segments can be merged in thecase of BIOVEC_VIRT_MERGEABLE && !BIOVEC_VIRT_OVERSIZE. However, anIOMMU can't merge segments if the total length of the segments islarger than max_segment_size (the LLD restriction).

Due to this bug, a LLD may get the larger number of segments thannr_hw_segments because the block layer puts more segments in a requestthan it should do.

This bug could happen on alpha, parisc, and sparc, which use VMERGE.

Like blk_hw_contig_segment() does, this patch uses hw_seg_size forsimplicity, which is a bit larger than an exact value (we don't needBIOVEC_VIRT_START_SIZE here).