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