Accepting request 1228595 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1228595 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/liburing?expand=0&rev=24
This commit is contained in:
commit
5e38c26abb
35
0001-test-init-mem-zero-the-ringbuf-memory.patch
Normal file
35
0001-test-init-mem-zero-the-ringbuf-memory.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
|
||||
Date: Wed, 4 Dec 2024 13:05:15 +0100
|
||||
Subject: test/init-mem: zero the ringbuf memory
|
||||
References: fix-test-crash
|
||||
Patch-mainline: Submitted, #1293
|
||||
|
||||
This is a similar fix to commit 8100d7b5f862 (test/buf-ring-nommap: zero
|
||||
the ringbuf memory). The same is needed for test/init-mem as it crashes
|
||||
with MALLOC_PERTURB_=69 too.
|
||||
|
||||
So zero the ringbuf memory after posix_memalign() too.
|
||||
|
||||
Fixes #1291.
|
||||
|
||||
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
|
||||
---
|
||||
test/init-mem.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/test/init-mem.c b/test/init-mem.c
|
||||
index 59973c8b7521..8b139fedd83b 100644
|
||||
--- a/test/init-mem.c
|
||||
+++ b/test/init-mem.c
|
||||
@@ -41,6 +41,8 @@ static int setup_ctx(struct ctx *ctx, struct q_entries *q)
|
||||
if (posix_memalign(&ctx->mem, 4096, 2*1024*1024))
|
||||
return T_EXIT_FAIL;
|
||||
|
||||
+ memset(ctx->mem, 0, 2*1024*1024);
|
||||
+
|
||||
ctx->pre = ctx->mem + 4096 - sizeof(unsigned long long);
|
||||
*ctx->pre = PRE_RED;
|
||||
|
||||
--
|
||||
2.47.1
|
||||
|
39
0001-test-rsrc_tags-use-correct-buffer-index-for-test.patch
Normal file
39
0001-test-rsrc_tags-use-correct-buffer-index-for-test.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From: Jens Axboe <axboe@kernel.dk>
|
||||
Date: Sun, 27 Oct 2024 18:48:55 -0600
|
||||
Subject: test/rsrc_tags: use correct buffer index for test
|
||||
References: fix-kernel-6.13
|
||||
Git-repo: https://github.com/axboe/liburing
|
||||
Git-commit: 91eecf3a88aa7f72898c17b530d3873331cc1661
|
||||
Patch-mainline: 2.9
|
||||
|
||||
The test is reading from buffer 0, but updating buffer 1. It's expecting
|
||||
buffer 1 not to be put until the per-ring state allows it, but with
|
||||
per-node refs, this is no longer true. However what is true, is that if
|
||||
we use the right buffer, then the ordering will be observed.
|
||||
|
||||
Hence use buffer offset 1 for both the read and the update test, then
|
||||
the test is actually testing what it should be testing. And it'll pass
|
||||
without full buffer table pinning.
|
||||
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
|
||||
---
|
||||
test/rsrc_tags.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/rsrc_tags.c b/test/rsrc_tags.c
|
||||
index 95f65e930ee5..e78cfe403bfb 100644
|
||||
--- a/test/rsrc_tags.c
|
||||
+++ b/test/rsrc_tags.c
|
||||
@@ -184,7 +184,7 @@ static int test_buffers_update(void)
|
||||
|
||||
/* test that CQE is not emitted before we're done with a buffer */
|
||||
sqe = io_uring_get_sqe(&ring);
|
||||
- io_uring_prep_read_fixed(sqe, pipes[0], tmp_buf, 10, 0, 0);
|
||||
+ io_uring_prep_read_fixed(sqe, pipes[0], tmp_buf, 10, 0, 1);
|
||||
sqe->user_data = 100;
|
||||
ret = io_uring_submit(&ring);
|
||||
if (ret != 1) {
|
||||
--
|
||||
2.47.1
|
||||
|
BIN
liburing-2.6.tar.bz2
(Stored with Git LFS)
BIN
liburing-2.6.tar.bz2
(Stored with Git LFS)
Binary file not shown.
3
liburing-2.8.tar.gz
Normal file
3
liburing-2.8.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3ed7891d1b2bbe743ef3fb6d0a4970e630aa02d7c7bd3b0212791fb7be815984
|
||||
size 390788
|
@ -1,3 +1,46 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 4 11:38:54 UTC 2024 - Jiri Slaby <jslaby@suse.cz>
|
||||
|
||||
- switch URLs to the current location on github
|
||||
- Update to 2.8
|
||||
* Add support for incrementally/partially consumed provided buffers,
|
||||
usable with the provided buffer ring support.
|
||||
* Add support for foo_and_wait_min_timeout(), where it's possible to
|
||||
define a minimum timeout for waiting to get batches of completions,
|
||||
but if that fails, extend for a longer timeout without having any
|
||||
extra context switches.
|
||||
* Add support for using different clock sources for completion waiting.
|
||||
* Great increase coverage of test cases, test case improvements and
|
||||
fixes.
|
||||
* Don't leak _GNU_SOURCE via pkb-config --cflags
|
||||
* Support for address sanitizer
|
||||
* Add examples/kdigest sample program
|
||||
* Add discard helper, test, and man page
|
||||
* Man page updates
|
||||
* Sync with kernel 6.10
|
||||
* send/recv bundle support
|
||||
* accept nowait and CQE_F_MORE
|
||||
* Add and update test cases
|
||||
* Fix io_uring_queue_init_mem() returning a value that was too small,
|
||||
potentially causing memory corruption in userspace by overwriting
|
||||
64 bytes beyond the returned value. Also add test case for that.
|
||||
* Add 64-bit length variants of io_uring_prep_{m,f}advise()
|
||||
* Add BIND/LISTEN support and helpers / man pages
|
||||
* Add io_uring_enable_rings.3 man page
|
||||
* Fix bug in io_uring_prep_read_multishot()
|
||||
* Fixup bundle test cases
|
||||
* Add fixed-hugepage test case
|
||||
* Fix io_uring_prep_fixed_fd_install.3 man page
|
||||
* Note 'len' == 0 requirement in io_uring_prep_send.3 man page
|
||||
* Fix some test cases for skipping on older kernels
|
||||
- drop (they are upstream)
|
||||
* test-buf-ring-nommap-skip-the-test-on-queue-init-ENO.patch
|
||||
* test-buf-ring-nommap-zero-the-ringbuf-memory.patch
|
||||
- add
|
||||
* 0001-test-init-mem-zero-the-ringbuf-memory.patch
|
||||
* 0001-test-rsrc_tags-use-correct-buffer-index-for-test.patch
|
||||
- cleanup spec file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 8 10:21:50 UTC 2024 - Valentin Lefebvre <valentin.lefebvre@suse.com>
|
||||
|
||||
|
@ -18,16 +18,16 @@
|
||||
|
||||
%define lname liburing2
|
||||
Name: liburing
|
||||
Version: 2.6
|
||||
Version: 2.8
|
||||
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
|
||||
Patch0: test-buf-ring-nommap-zero-the-ringbuf-memory.patch
|
||||
# PATCH-FIX-UPSTREAM f11c1ab393185aecedc3f1445b0dff5b187f58c1
|
||||
Patch1: test-buf-ring-nommap-skip-the-test-on-queue-init-ENO.patch
|
||||
URL: https://github.com/axboe/liburing
|
||||
Source: https://github.com/axboe/liburing/archive/refs/tags/%{name}-%{version}.tar.gz
|
||||
Patch0: 0001-test-init-mem-zero-the-ringbuf-memory.patch
|
||||
Patch1: 0001-test-rsrc_tags-use-correct-buffer-index-for-test.patch
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: procps
|
||||
@ -67,7 +67,7 @@ This package provides header files to include and libraries to link with
|
||||
for the Linux-native io_uring.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
%autosetup -p1 -n liburing-liburing-%{version}
|
||||
|
||||
%build
|
||||
# not autotools, so configure macro doesn't work
|
||||
@ -77,10 +77,10 @@ for the Linux-native io_uring.
|
||||
export CFLAGS="%{optflags} -fno-stack-protector"
|
||||
export CPPFLAGS="%{optflags} -fno-stack-protector"
|
||||
%endif
|
||||
sh ./configure --prefix=%{_prefix} \
|
||||
./configure --prefix=%{_prefix} \
|
||||
--includedir=%{_includedir} \
|
||||
--libdir=/%{_libdir} \
|
||||
--libdevdir=/%{_libdir} \
|
||||
--libdir=%{_libdir} \
|
||||
--libdevdir=%{_libdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--datadir=%{_datadir}
|
||||
%make_build -C src
|
||||
@ -89,13 +89,15 @@ sh ./configure --prefix=%{_prefix} \
|
||||
# io_uring syscalls not supported as of qemu 7.0.0 and would test the host
|
||||
# kernel anyway not the target kernel..
|
||||
%if !0%{?qemu_user_space_build}
|
||||
/usr/bin/make %{?_smp_mflags} runtests
|
||||
%make_build runtests
|
||||
%endif
|
||||
|
||||
%install
|
||||
%make_install
|
||||
rm -v %{buildroot}%{_libdir}/%{name}*.a
|
||||
|
||||
%fdupes %{buildroot}/%{_mandir}/
|
||||
|
||||
%post -n %{lname} -p /sbin/ldconfig
|
||||
%postun -n %{lname} -p /sbin/ldconfig
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
From f11c1ab393185aecedc3f1445b0dff5b187f58c1 Mon Sep 17 00:00:00 2001
|
||||
From: Jens Axboe <axboe@kernel.dk>
|
||||
Date: Thu, 8 Aug 2024 07:34:46 -0600
|
||||
Subject: [PATCH] test/buf-ring-nommap: skip the test on queue init ENOMEM
|
||||
failure
|
||||
|
||||
Fixes: https://github.com/axboe/liburing/issues/1200
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
test/buf-ring-nommap.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/buf-ring-nommap.c b/test/buf-ring-nommap.c
|
||||
index 17c1495..32a372c 100644
|
||||
--- a/test/buf-ring-nommap.c
|
||||
+++ b/test/buf-ring-nommap.c
|
||||
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
|
||||
p.flags = IORING_SETUP_NO_MMAP;
|
||||
ret = io_uring_queue_init_mem(1, &ring, &p, ring_mem, 16384);
|
||||
if (ret < 0) {
|
||||
- if (ret == -EINVAL)
|
||||
+ if (ret == -EINVAL || ret == -ENOMEM)
|
||||
return T_EXIT_SKIP;
|
||||
fprintf(stderr, "queue init failed %d\n", ret);
|
||||
return T_EXIT_FAIL;
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 8100d7b5f862fa514d821e8bd8f99d0de79af571 Mon Sep 17 00:00:00 2001
|
||||
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
|
||||
Date: Fri, 12 Jul 2024 13:17:03 +0200
|
||||
Subject: [PATCH] test/buf-ring-nommap: zero the ringbuf memory
|
||||
|
||||
The test crashes when run under the openSUSE build system. It sets
|
||||
MALLOC_PERTURB_=69 in the environment, so the allocated memory is
|
||||
initialized to 0xba.
|
||||
|
||||
Later in io_uring_get_sqe() -> _io_uring_get_sqe():
|
||||
1424 if (next - head <= sq->ring_entries) {
|
||||
(gdb) p *sq
|
||||
$2 = {khead = 0x55555555d000, ktail = 0x55555555d004,
|
||||
kring_mask = 0x55555555d010, kring_entries = 0x55555555d018,
|
||||
kflags = 0x55555555d024, kdropped = 0x55555555d020, array = 0x0,
|
||||
sqes = 0x55555555c000, sqe_head = 0, sqe_tail = 0, ring_sz = 0,
|
||||
ring_ptr = 0x55555555d000, ring_mask = 0, ring_entries = 1, pad = {0, 0}}
|
||||
(gdb) p sq->ring_entries
|
||||
$3 = 1
|
||||
(gdb) p next
|
||||
$4 = 1
|
||||
(gdb) p/x head
|
||||
$6 = 0xbabababa
|
||||
|
||||
And that causes a crash, of course.
|
||||
|
||||
Fix that by zeroing the memory after posix_memalign().
|
||||
|
||||
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
|
||||
---
|
||||
test/buf-ring-nommap.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/test/buf-ring-nommap.c b/test/buf-ring-nommap.c
|
||||
index 1e47f28..17c1495 100644
|
||||
--- a/test/buf-ring-nommap.c
|
||||
+++ b/test/buf-ring-nommap.c
|
||||
@@ -41,6 +41,8 @@ int main(int argc, char *argv[])
|
||||
if (posix_memalign(&ring_mem, 16384, 16384))
|
||||
return T_EXIT_FAIL;
|
||||
|
||||
+ memset(ring_mem, 0, 16384);
|
||||
+
|
||||
p.flags = IORING_SETUP_NO_MMAP;
|
||||
ret = io_uring_queue_init_mem(1, &ring, &p, ring_mem, 16384);
|
||||
if (ret < 0) {
|
||||
--
|
||||
2.35.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user