From c22a6c421fc23c886bba527d4949c737c8b77470c5c02a5383a5406489e1bc8a Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 20 Apr 2023 20:53:25 +0000 Subject: [PATCH 1/2] Accepting request 1080966 from home:gbertazi:branches:devel:libraries:c_c++ - Add 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch fixes test with kernel <= 5.16 Upstream patch fixing test/file-verify.t on the SP4 kernel. OBS-URL: https://build.opensuse.org/request/show/1080966 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liburing?expand=0&rev=29 --- ....t-Don-t-run-over-mlock-limit-when-r.patch | 46 +++++++++++++++++++ liburing.changes | 6 +++ liburing.spec | 1 + 3 files changed, 53 insertions(+) create mode 100644 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch diff --git a/0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch b/0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch new file mode 100644 index 0000000..f52114d --- /dev/null +++ b/0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch @@ -0,0 +1,46 @@ +From 87943e896268efbe85e15f7e59f45a042d2ba8f7 Mon Sep 17 00:00:00 2001 +From: Gabriel Krisman Bertazi +Date: Thu, 20 Apr 2023 14:23:55 -0400 +Subject: [PATCH] test/file-verify.t: Don't run over mlock limit when run as + non-root + +test/file-verify tries to get 2MB of pinned memory at once, which is +higher than the default allowed for non-root users in older +kernels (64kb before v5.16, nowadays 8mb). Skip the test for non-root +users if the registration fails instead of failing the test. + +Signed-off-by: Gabriel Krisman Bertazi +--- + test/file-verify.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/test/file-verify.c b/test/file-verify.c +index f33b24a..89cbb02 100644 +--- a/test/file-verify.c ++++ b/test/file-verify.c +@@ -381,9 +381,12 @@ static int test(struct io_uring *ring, const char *fname, int buffered, + v[i].iov_base = buf[i]; + v[i].iov_len = CHUNK_SIZE; + } +- ret = io_uring_register_buffers(ring, v, READ_BATCH); ++ ret = t_register_buffers(ring, v, READ_BATCH); + if (ret) { +- fprintf(stderr, "Error buffer reg %d\n", ret); ++ if (ret == T_SETUP_SKIP) { ++ ret = 0; ++ goto free_bufs; ++ } + goto err; + } + } +@@ -477,6 +480,7 @@ static int test(struct io_uring *ring, const char *fname, int buffered, + done: + if (registered) + io_uring_unregister_buffers(ring); ++free_bufs: + if (vectored) { + for (j = 0; j < READ_BATCH; j++) + for (i = 0; i < nr_vecs; i++) +-- +2.40.0 + diff --git a/liburing.changes b/liburing.changes index a35f563..4a7ccca 100644 --- a/liburing.changes +++ b/liburing.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 20 20:26:32 UTC 2023 - Gabriel Krisman Bertazi + +- Add 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch + fixes test with kernel <= 5.16 + ------------------------------------------------------------------- Tue Feb 21 13:10:33 UTC 2023 - Jiri Slaby diff --git a/liburing.spec b/liburing.spec index acf301f..7e1e253 100644 --- a/liburing.spec +++ b/liburing.spec @@ -28,6 +28,7 @@ Source: https://git.kernel.dk/cgit/liburing/snapshot/%{name}-%{version}. # PATCH-FIX-UPSTREAM: fix tests on big endian Patch1: 0001-test-helpers-fix-socket-length-type.patch Patch2: 0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch +Patch3: 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: procps From 72b4cf4dda67c495213d79ca9a1b1eb80d6b8aa8becce3602a8a5cde6223bcb9 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 20 Apr 2023 20:59:59 +0000 Subject: [PATCH 2/2] add bz tag for 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liburing?expand=0&rev=30 --- liburing.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liburing.changes b/liburing.changes index 4a7ccca..41d4b20 100644 --- a/liburing.changes +++ b/liburing.changes @@ -2,7 +2,7 @@ Thu Apr 20 20:26:32 UTC 2023 - Gabriel Krisman Bertazi - Add 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch - fixes test with kernel <= 5.16 + fixes test with kernel <= 5.16 (bsc#1209723) ------------------------------------------------------------------- Tue Feb 21 13:10:33 UTC 2023 - Jiri Slaby