From: Louvian Lyndal <[email protected]>
To: Ammar Faizi <[email protected]>,
Jens Axboe <[email protected]>,
Pavel Begunkov <[email protected]>
Cc: Ammar Faizi <[email protected]>,
io-uring Mailing List <[email protected]>,
Bedirhan KURT <[email protected]>
Subject: Re: [PATCH v3 RFC liburing 2/4] src/{queue,register,setup}: Don't use `__sys_io_uring*`
Date: Sat, 2 Oct 2021 15:12:12 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 10/2/21 8:48 AM, Ammar Faizi wrote:
> @@ -158,7 +142,7 @@ int io_uring_register_files_tags(struct io_uring *ring,
> break;
> } while (1);
>
> - return ret < 0 ? -errno : ret;
> + return (ret < 0) ? ret : 0;
> }
This is wrong, you changed the logic, should've been "return ret;".
Not all successful call returns 0.
>
> int io_uring_register_files(struct io_uring *ring, const int *files,
> @@ -167,12 +151,12 @@ int io_uring_register_files(struct io_uring *ring, const int *files,
> int ret, did_increase = 0;
>
> do {
> - ret = __sys_io_uring_register(ring->ring_fd,
> - IORING_REGISTER_FILES, files,
> - nr_files);
> + ret = ____sys_io_uring_register(ring->ring_fd,
> + IORING_REGISTER_FILES, files,
> + nr_files);
> if (ret >= 0)
> break;
> - if (errno == EMFILE && !did_increase) {
> + if (ret == -EMFILE && !did_increase) {
> did_increase = 1;
> increase_rlimit_nofile(nr_files);
> continue;
> @@ -180,55 +164,44 @@ int io_uring_register_files(struct io_uring *ring, const int *files,
> break;
> } while (1);
>
> - return ret < 0 ? -errno : ret;
> + return (ret < 0) ? ret : 0;
> }
The same thing here!
--
Louvian Lyndal
next prev parent reply other threads:[~2021-10-02 8:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 1:48 [PATCHSET v3 RFC liburing 0/4] Implement the kernel style return value Ammar Faizi
2021-10-02 1:48 ` [PATCH v3 RFC liburing 1/4] src/syscall: " Ammar Faizi
2021-10-02 1:48 ` [PATCH v3 RFC liburing 2/4] src/{queue,register,setup}: Don't use `__sys_io_uring*` Ammar Faizi
2021-10-02 8:12 ` Louvian Lyndal [this message]
2021-10-02 9:04 ` Ammar Faizi
2021-10-02 1:48 ` [PATCH v3 RFC liburing 3/4] Wrap all syscalls in a kernel style return value Ammar Faizi
2021-10-02 1:48 ` [PATCH v3 RFC liburing 4/4] src/{queue,register,setup}: Remove `#include <errno.h>` Ammar Faizi
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[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