• Ming Lei's avatar
    nvmet: fix building bvec from sg list · 02db9954
    Ming Lei authored
    There are two mistakes for building bvec from sg list for file
    backed ns:
    
    - use request data length to compute number of io vector, this way
    doesn't consider sg->offset, and the result may be smaller than required
    io vectors
    
    - bvec->bv_len isn't capped by sg->length
    
    This patch fixes this issue by building bvec from sg directly, given
    the whole IO stack is ready for multi-page bvec.
    Reported-by: default avatarYi Zhang <yi.zhang@redhat.com>
    Fixes: 3a85a5de ("nvme-loop: add a NVMe loopback host driver")
    Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    02db9954
io-cmd-file.c 9.32 KB