• Ming Lei's avatar
    dm: add dm_bio_rewind() API to DM core · 61cbe788
    Ming Lei authored
    Commit 7759eb23 ("block: remove bio_rewind_iter()") removed
    a similar API for the following reasons:
        ```
        It is pointed that bio_rewind_iter() is one very bad API[1]:
    
        1) bio size may not be restored after rewinding
    
        2) it causes some bogus change, such as 5151842b (block: reset
        bi_iter.bi_done after splitting bio)
    
        3) rewinding really makes things complicated wrt. bio splitting
    
        4) unnecessary updating of .bi_done in fast path
    
        [1] https://marc.info/?t=153549924200005&r=1&w=2
    
        So this patch takes Kent's suggestion to restore one bio into its original
        state via saving bio iterator(struct bvec_iter) in bio_integrity_prep(),
        given now bio_rewind_iter() is only used by bio integrity code.
        ```
    However, saving off a copy of the 32 bytes bio->bi_iter in case rewind
    needed isn't efficient because it bloats per-bio-data for what is an
    unlikely case. That suggestion also ignores the need to restore
    crypto and integrity ...
    61cbe788
Makefile 3.8 KB