From: Valerie Aurora <val@versity.com>
To: rpdfs-devel@lists.linux.dev
Cc: Valerie Aurora <val@versity.com>
Subject: [PATCH 2/3] Workaround for short read from io_uring on aarch64
Date: Tue, 24 Feb 2026 17:33:25 +0100 [thread overview]
Message-ID: <20260224163327.2441-3-val@versity.com> (raw)
In-Reply-To: <20260224163327.2441-1-val@versity.com>
For some reason, io_uring returns a short read even with MSG_WAITALL -
but on aarch64 and not x86_64. Work around that with an outer loop
---
utask/net.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/utask/net.c b/utask/net.c
index 7f21e4c..35919fd 100644
--- a/utask/net.c
+++ b/utask/net.c
@@ -265,11 +265,19 @@ static ssize_t recv_waiter(int fd, void *buf, size_t size, int flags)
{
struct utask_cqe_waiter waiter;
struct io_uring_sqe *sqe;
+ size_t len = 0;
int ret;
- sqe = utask_get_sqe_waiter(&waiter);
- io_uring_prep_recv(sqe, fd, buf, size, flags | MSG_WAITALL);
- ret = utask_wait_event_task(waiter.completed);
+ /* TODO: Figure out why io_uring returns a short read on aarch64 */
+ while (len < size) {
+ sqe = utask_get_sqe_waiter(&waiter);
+ io_uring_prep_recv(sqe, fd, buf + len, size - len, flags | MSG_WAITALL);
+ ret = utask_wait_event_task(waiter.completed);
+
+ if (waiter.res < 0)
+ break;
+ len += waiter.res;
+ }
/* == 0 when fd is shutdown/disconnected */
BUG_ON(ret == 0 && waiter.res > 0 && waiter.res != size);
--
2.49.0
next prev parent reply other threads:[~2026-02-24 16:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 16:33 [PATCH 0/3] rpdfs-progs: ARM64 support and documentation Valerie Aurora
2026-02-24 16:33 ` [PATCH 1/3] Initial support for ARM64, incompatible with x86_64 Valerie Aurora
2026-02-25 23:36 ` Zach Brown
2026-02-24 16:33 ` Valerie Aurora [this message]
2026-02-25 23:37 ` [PATCH 2/3] Workaround for short read from io_uring on aarch64 Zach Brown
2026-02-24 16:33 ` [PATCH 3/3] Update documentation Valerie Aurora
2026-02-25 23:39 ` Zach Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260224163327.2441-3-val@versity.com \
--to=val@versity.com \
--cc=rpdfs-devel@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.