io_uring: fix off-by one bvec index
PATCH 1/1 io_uring: fix off-by one bvec index
From: Keith Busch <[email protected]>
If the offset equals the bv_len of the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation.
--- io_uring/rsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/rsrc.c +1 -1
@@ -1258,7 +1258,7 @@ int io_import_fixed(int ddir, struct iov_iter *iter,*/ const struct bio_vec *bvec = imu->bvec; -if (offset <= bvec->bv_len) { +if (offset < bvec->bv_len) {/* * Note, huge pages buffers consists of one large * bvec entry and should always go this way. The other
Signature · 1 line
2.34.1
Jens Axboe
maintainerQuoted 6 lines · Keith Busch
From: Keith Busch <[email protected]>
If the offset equals the
bv_lenof the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation.
Thanks Keith, that was fast (I sent in the report...). I applied this with a fixes and stable tag.
Signature · 1 line
Jens Axboe
Quoted 6 lines · Keith Busch
If the offset equals the
bv_lenof the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation.
Applied, thanks!
[1/1] io_uring: fix off-by one bvec index
commit: d6fef34ee4d102be448146f24caf96d7b4a05401
Best regards,
Signature · 1 line
Jens Axboe