nvmet: fix building bvec from sg list
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: NYi Zhang <yi.zhang@redhat.com> Fixes: 3a85a5de ("nvme-loop: add a NVMe loopback host driver") Signed-off-by: NMing Lei <ming.lei@redhat.com> Signed-off-by: NChristoph Hellwig <hch@lst.de>
Showing
想要评论请 注册 或 登录