From: Olivier Langlois <[email protected]>
To: [email protected]
Subject: IOSQE_BUFFER_SELECT buffer returned even in case of failure?
Date: Wed, 09 Jun 2021 15:19:23 -0400 [thread overview]
Message-ID: <[email protected]> (raw)
the man page says the following:
If succesful, the resulting CQE will have IORING_CQE_F_BUFFER set
in the flags part of the struct, and the upper IORING_CQE_BUFFER_SHIFT
bits will contain the ID of the selected buffers.
based on my understanding of the kernel code (it could wrong. testing
is still ongoing to be 100% sure), the buffer will be returned even if
the underlying syscall fails. (I have only checked io_read() for
IORING_OP_READ).
At the minimum, the man page should be clarified to better reflect the
code behavior. (and there is a missing 's' in succesful)
ideally, imho, I believe the code should be modified to do what the man
page says because:
1. doing otherwise is counter-intuitive and error-prone (I cannot think
of a single example of a syscall failing and still require the user to
free the allocated resources)
2. it is inefficient because the buffer is unneeded since there is no
data to transfer back to the user and the buffer will need to be
returned back to io_uring to avoid a leak.
Greetings,
Olivier
next reply other threads:[~2021-06-09 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 19:19 Olivier Langlois [this message]
2021-06-10 18:42 ` IOSQE_BUFFER_SELECT buffer returned even in case of failure? Olivier Langlois
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=57ba227ebda93e653854d272d288cd65a57dd127.camel@trillion01.com \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox