Skip to content
Commit 02db9954 authored by Ming Lei's avatar Ming Lei Committed by Christoph Hellwig
Browse files

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: 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>
parent cc2278c4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment