From 380a7155032affaee766af2ab5c3ba0a0529ee7509b1c2b1ff1d46d6be73f30a Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 20 Jan 2023 22:51:30 +0000 Subject: [PATCH 1/2] Accepting request 1036718 from home:dirkmueller:Factory - update to 2.3: * Support non-libc build for aarch64. * Add io_uring_{enter,enter2,register,setup} syscall functions. * Add sync cancel interface, io_uring_register_sync_cancel(). * Fix return value of io_uring_submit_and_wait_timeout() to match the man page. * Improvements to the regression tests * Add support and test case for passthrough IO * Add recv and recvmsg multishot helpers and support * Add documentation and support for IORING_SETUP_DEFER_TASKRUN * Fix potential missing kernel entry with IORING_SETUP_IOPOLL * Add support and documentation for zero-copy network transmit * Various optimizations * Many cleanups * Many man page additions and updates - drop handle-eintr.patch, test-xattr-don-t-rely-on-NUL-termination.patch: upstream OBS-URL: https://build.opensuse.org/request/show/1036718 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liburing?expand=0&rev=24 --- handle-eintr.patch | 52 ------------------- liburing-2.2.tar.bz2 | 3 -- liburing-2.3.tar.bz2 | 3 ++ liburing.changes | 20 +++++++ liburing.spec | 8 +-- ...-xattr-don-t-rely-on-NUL-termination.patch | 46 ---------------- 6 files changed, 24 insertions(+), 108 deletions(-) delete mode 100644 handle-eintr.patch delete mode 100644 liburing-2.2.tar.bz2 create mode 100644 liburing-2.3.tar.bz2 delete mode 100644 test-xattr-don-t-rely-on-NUL-termination.patch diff --git a/handle-eintr.patch b/handle-eintr.patch deleted file mode 100644 index 394b27f..0000000 --- a/handle-eintr.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- liburing-2.2/test/ce593a6c480a.c -+++ liburing-2.2/test/ce593a6c480a.c -@@ -111,15 +111,16 @@ - (void*) (intptr_t) other_fd); - - /* Wait on the event fd for an event to be ready */ -- ret = read(loop_fd, buf, 8); -- if (ret < 0) { -- perror("read"); -- return 1; -- } else if (ret != 8) { -- fprintf(stderr, "Odd-sized eventfd read: %d\n", ret); -- return 1; -- } -- -+ do { -+ ret = read(loop_fd, buf, 8); -+ if (ret < 0 && errno != EINTR) { -+ perror("read"); -+ return 1; -+ } else if (ret > 0 && ret != 8) { -+ fprintf(stderr, "Odd-sized eventfd read: %d\n", ret); -+ return 1; -+ } -+ } while (ret < 0); - - ret = io_uring_wait_cqe(&ring, &cqe); - if (ret) { ---- liburing-2.2/test/io-cancel.c -+++ liburing-2.2/test/io-cancel.c -@@ -366,10 +366,17 @@ - } else { - int wstatus; - -- if (waitpid(p, &wstatus, 0) == (pid_t)-1) { -- perror("waitpid()"); -- return 1; -- } -+ do { -+ if (waitpid(p, &wstatus, 0) == (pid_t)-1) { -+ if (errno == EINTR) { -+ continue; -+ } -+ perror("waitpid()"); -+ return 1; -+ } -+ break; -+ } while (1); -+ - if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus)) { - fprintf(stderr, "child failed %i\n", WEXITSTATUS(wstatus)); - return 1; diff --git a/liburing-2.2.tar.bz2 b/liburing-2.2.tar.bz2 deleted file mode 100644 index 94c5db4..0000000 --- a/liburing-2.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0fcd25dc1eb32cbeb534219f8e7fcfeadbd8dc2304aa447148e5ca8408076f22 -size 172733 diff --git a/liburing-2.3.tar.bz2 b/liburing-2.3.tar.bz2 new file mode 100644 index 0000000..4e69dfe --- /dev/null +++ b/liburing-2.3.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f242bd38777c79ee4e1169f817e08ce111b03e033ef9a1bde274d3196d4de36e +size 197929 diff --git a/liburing.changes b/liburing.changes index 6e55787..e49e998 100644 --- a/liburing.changes +++ b/liburing.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Fri Nov 18 21:26:17 UTC 2022 - Dirk Müller + +- update to 2.3: + * Support non-libc build for aarch64. + * Add io_uring_{enter,enter2,register,setup} syscall functions. + * Add sync cancel interface, io_uring_register_sync_cancel(). + * Fix return value of io_uring_submit_and_wait_timeout() to match the + man page. + * Improvements to the regression tests + * Add support and test case for passthrough IO + * Add recv and recvmsg multishot helpers and support + * Add documentation and support for IORING_SETUP_DEFER_TASKRUN + * Fix potential missing kernel entry with IORING_SETUP_IOPOLL + * Add support and documentation for zero-copy network transmit + * Various optimizations + * Many cleanups + * Many man page additions and updates +- drop handle-eintr.patch, test-xattr-don-t-rely-on-NUL-termination.patch: upstream + ------------------------------------------------------------------- Sun Sep 25 14:34:41 UTC 2022 - Dirk Müller diff --git a/liburing.spec b/liburing.spec index 116498d..917aad8 100644 --- a/liburing.spec +++ b/liburing.spec @@ -18,19 +18,13 @@ %define lname liburing2 Name: liburing -Version: 2.2 +Version: 2.3 Release: 0 Summary: Linux-native io_uring I/O access library License: (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT Group: Development/Libraries/C and C++ URL: https://git.kernel.dk/cgit/liburing Source: https://git.kernel.dk/cgit/liburing/snapshot/%{name}-%{version}.tar.bz2 -# PATCH-FIX-UPSTREAM: has been accepted upstream -Patch0: test-xattr-don-t-rely-on-NUL-termination.patch -# PATCH-FIX-UPSTREAM: has been accepted upstream -# [1/1] Handle EINTR in tests -# commit: fa67f6aedcfdaffc14cbf0b631253477b2565ef0 -Patch2: handle-eintr.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: procps diff --git a/test-xattr-don-t-rely-on-NUL-termination.patch b/test-xattr-don-t-rely-on-NUL-termination.patch deleted file mode 100644 index fb4849e..0000000 --- a/test-xattr-don-t-rely-on-NUL-termination.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Jiri Slaby -Date: Tue, 16 Aug 2022 12:44:14 +0200 -Subject: test/xattr: don't rely on NUL-termination -Patch-mainline: yes -Git-commit: bf3fedba890e66d644692910964fe1d8cbf4fb1b -References: bsc#1202413 - -The returned value from io_uring_fgetxattr() needs not be NUL-terminated, -as we stored non-NUL-terminated string by io_uring_fsetxattr() -previously. - -So don't use strlen() on value, but on VALUE1, and VALUE2 respectively. - -This fixes random test failures. - -Cc: Stefan Roesch -Fixes: d6515e06f73c ("liburing: Add new test program to verify xattr support") -Signed-off-by: Jiri Slaby ---- - test/xattr.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/xattr.c b/test/xattr.c -index d88059cb..101d82b3 100644 ---- a/test/xattr.c -+++ b/test/xattr.c -@@ -210,14 +210,14 @@ static int test_fxattr(void) - - /* Test reading attributes. */ - value_len = io_uring_fgetxattr(&ring, fd, KEY1, value, XATTR_SIZE); -- if (value_len != strlen(value) || strncmp(value, VALUE1, value_len)) { -+ if (value_len != strlen(VALUE1) || strncmp(value, VALUE1, value_len)) { - fprintf(stderr, "Error: fgetxattr expected value: %s, returned value: %s\n", VALUE1, value); - rc = -1; - goto Exit; - } - - value_len = io_uring_fgetxattr(&ring, fd, KEY2, value, XATTR_SIZE); -- if (value_len != strlen(value)|| strncmp(value, VALUE2, value_len)) { -+ if (value_len != strlen(VALUE2) || strncmp(value, VALUE2, value_len)) { - fprintf(stderr, "Error: fgetxattr expected value: %s, returned value: %s\n", VALUE2, value); - rc = -1; - goto Exit; --- -2.35.3 - From 17d092784d73b7f6ca7da755022b8d41de54ed8e23b8f6f032ac2adf2e8b93c0 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 21 Jan 2023 09:20:15 +0000 Subject: [PATCH 2/2] - add 0001-test-helpers-fix-socket-length-type.patch fixes tests on big endian OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liburing?expand=0&rev=25 --- ...-test-helpers-fix-socket-length-type.patch | 41 +++++++++++++++++++ liburing.changes | 6 +++ liburing.spec | 4 +- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0001-test-helpers-fix-socket-length-type.patch diff --git a/0001-test-helpers-fix-socket-length-type.patch b/0001-test-helpers-fix-socket-length-type.patch new file mode 100644 index 0000000..84b45d4 --- /dev/null +++ b/0001-test-helpers-fix-socket-length-type.patch @@ -0,0 +1,41 @@ +From b5caa618565c0c6d0053f7b1bae2423cd317660c Mon Sep 17 00:00:00 2001 +From: Gabriel Krisman Bertazi +Date: Wed, 18 Jan 2023 11:48:06 -0300 +Subject: [PATCH] test/helpers: fix socket length type + +t_create_socket_pair uses size_t for paddrlen, which is uint64 on 64-bit +architecture, while the network syscalls expect uint32. The implicit +cast is always safe for little-endian here due to the structure format, +its small size and the fact it was previously zeroed - so the test +succeeds. + +Still, on BE machines, our CI caught a few tests crashing on +connect(). For instance: + +localhost:~/liburing/test # ./send_recv.t +connect failed +test_invalid failed + +Signed-off-by: Gabriel Krisman Bertazi +Link: https://lore.kernel.org/r/20230118144806.18352-1-krisman@suse.de +Signed-off-by: Jens Axboe +--- + test/helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/helpers.c b/test/helpers.c +index 869e903..37ba67c 100644 +--- a/test/helpers.c ++++ b/test/helpers.c +@@ -173,7 +173,7 @@ int t_create_socket_pair(int fd[2], bool stream) + int val; + struct sockaddr_in serv_addr; + struct sockaddr *paddr; +- size_t paddrlen; ++ socklen_t paddrlen; + + type |= SOCK_CLOEXEC; + fd[0] = socket(AF_INET, type, 0); +-- +2.39.0 + diff --git a/liburing.changes b/liburing.changes index e49e998..0cef41b 100644 --- a/liburing.changes +++ b/liburing.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jan 21 09:19:57 UTC 2023 - Dirk Müller + +- add 0001-test-helpers-fix-socket-length-type.patch + fixes tests on big endian + ------------------------------------------------------------------- Fri Nov 18 21:26:17 UTC 2022 - Dirk Müller diff --git a/liburing.spec b/liburing.spec index 917aad8..29b5d1e 100644 --- a/liburing.spec +++ b/liburing.spec @@ -1,7 +1,7 @@ # # spec file for package liburing # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,8 @@ License: (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT Group: Development/Libraries/C and C++ URL: https://git.kernel.dk/cgit/liburing Source: https://git.kernel.dk/cgit/liburing/snapshot/%{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM: fix tests on big endian +Patch1: 0001-test-helpers-fix-socket-length-type.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: procps