• Ming Lei's avatar
    md: multipath: don't hardcopy bio in .make_request path · fafcde3a
    Ming Lei authored
    Inside multipath_make_request(), multipath maps the incoming
    bio into low level device's bio, but it is totally wrong to
    copy the bio into mapped bio via '*mapped_bio = *bio'. For
    example, .__bi_remaining is kept in the copy, especially if
    the incoming bio is chained to via bio splitting, so .bi_end_io
    can't be called for the mapped bio at all in the completing path
    in this kind of situation.
    
    This patch fixes the issue by using clone style.
    
    Cc: stable@vger.kernel.org (v3.14+)
    Reported-and-tested-by: default avatarAndrea Righi <righi.andrea@gmail.com>
    Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
    Signed-off-by: default avatarShaohua Li <shli@fb.com>
    fafcde3a
multipath.c 13.2 KB