Pull request
-----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmLGlXYACgkQnKSrs4Gr c8jfNwf/fFfx4mPFwdnud9cseb9jFU44/RWJ2rJlYerbHIUUNvW0vAv1nGjuVVWT DeHxG2pkHPJQ5u4y/oivq4CCGGQ/Ukx/IEqJsnXEpWyKHosHJHlBrePt+/x+uygA RUOfReSq4gsK1FIcluuO/wnBzgREXL6lBsyIHtvG57hYSSESS10fCdRXBPJJMBcF pI8LpEgID5KuqPjXoO/Cv4qOXpOpO8540b8mzHP8wY1tYbBP9H4uqO1MJ/OFz8GU wDeRJEa66o9kwV7oym8T+KdZHR1f+Yfk0o1WmtfUgECJkM/8aUTvNog5SVeaHKqV 0ZQ4L6j8cprKXl9Ui+LXFp2YMMXV9g== =IjWZ -----END PGP SIGNATURE----- Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging Pull request # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmLGlXYACgkQnKSrs4Gr # c8jfNwf/fFfx4mPFwdnud9cseb9jFU44/RWJ2rJlYerbHIUUNvW0vAv1nGjuVVWT # DeHxG2pkHPJQ5u4y/oivq4CCGGQ/Ukx/IEqJsnXEpWyKHosHJHlBrePt+/x+uygA # RUOfReSq4gsK1FIcluuO/wnBzgREXL6lBsyIHtvG57hYSSESS10fCdRXBPJJMBcF # pI8LpEgID5KuqPjXoO/Cv4qOXpOpO8540b8mzHP8wY1tYbBP9H4uqO1MJ/OFz8GU # wDeRJEa66o9kwV7oym8T+KdZHR1f+Yfk0o1WmtfUgECJkM/8aUTvNog5SVeaHKqV # 0ZQ4L6j8cprKXl9Ui+LXFp2YMMXV9g== # =IjWZ # -----END PGP SIGNATURE----- # gpg: Signature made Thu 07 Jul 2022 01:42:38 PM +0530 # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] * tag 'block-pull-request' of https://gitlab.com/stefanha/qemu: block/io_uring: clarify that short reads can happen io_uring: fix short read slow path Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
a74c66b1b9
@ -73,12 +73,8 @@ static void luring_resubmit(LuringState *s, LuringAIOCB *luringcb)
|
||||
/**
|
||||
* luring_resubmit_short_read:
|
||||
*
|
||||
* Before Linux commit 9d93a3f5a0c ("io_uring: punt short reads to async
|
||||
* context") a buffered I/O request with the start of the file range in the
|
||||
* page cache could result in a short read. Applications need to resubmit the
|
||||
* remaining read request.
|
||||
*
|
||||
* This is a slow path but recent kernels never take it.
|
||||
* Short reads are rare but may occur. The remaining read request needs to be
|
||||
* resubmitted.
|
||||
*/
|
||||
static void luring_resubmit_short_read(LuringState *s, LuringAIOCB *luringcb,
|
||||
int nread)
|
||||
@ -89,7 +85,7 @@ static void luring_resubmit_short_read(LuringState *s, LuringAIOCB *luringcb,
|
||||
trace_luring_resubmit_short_read(s, luringcb, nread);
|
||||
|
||||
/* Update read position */
|
||||
luringcb->total_read = nread;
|
||||
luringcb->total_read += nread;
|
||||
remaining = luringcb->qiov->size - luringcb->total_read;
|
||||
|
||||
/* Shorten qiov */
|
||||
@ -103,7 +99,7 @@ static void luring_resubmit_short_read(LuringState *s, LuringAIOCB *luringcb,
|
||||
remaining);
|
||||
|
||||
/* Update sqe */
|
||||
luringcb->sqeq.off = nread;
|
||||
luringcb->sqeq.off += nread;
|
||||
luringcb->sqeq.addr = (__u64)(uintptr_t)luringcb->resubmit_qiov.iov;
|
||||
luringcb->sqeq.len = luringcb->resubmit_qiov.niov;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user