• Joe Thornber's avatar
    [PATCH] dm: bio split fix · d68017fa
    Joe Thornber authored
    The block layer does not honour bio->bi_size when issuing io, instead
    it performs io to the complete bvecs.  This means we have to change
    the bio splitting code slightly.
    
    Given a bio we repeatedly apply one of the following three operations
    until there is no more io left in the bio:
    
    1) The remaining io does not cross an io/target boundary, so just
       create a clone and issue all of the io.
    
    2) There are some bvecs at the start of the bio that are not split by
       a target boundary.  Create a clone for these bvecs only.
    
    3) The first bvec needs splitting, use bio_alloc() to create *two*
       bios, one for the first half of the bvec, the other for the second
       half.  A bvec can never contain more than one boundary.
    d68017fa
dm.c 16.6 KB