{"id":2227168,"url":"http://patchwork.ozlabs.org/api/patches/2227168/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260423095834.11932-4-chrubis@suse.cz/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260423095834.11932-4-chrubis@suse.cz>","list_archive_url":null,"date":"2026-04-23T09:58:29","name":"[3/8] syscalls: Add epoll_wait09","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"b6a27363fcf0dfab22dd2ace3ce9db469de8f541","submitter":{"id":8530,"url":"http://patchwork.ozlabs.org/api/people/8530/?format=json","name":"Cyril Hrubis","email":"chrubis@suse.cz"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260423095834.11932-4-chrubis@suse.cz/mbox/","series":[{"id":501170,"url":"http://patchwork.ozlabs.org/api/series/501170/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=501170","date":"2026-04-23T09:58:26","name":"Add more epoll tests","version":1,"mbox":"http://patchwork.ozlabs.org/series/501170/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2227168/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2227168/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=RoXfNoq1;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=eHIMtvw7;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=0wfNlcUT;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=YCVD1C1T;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out1.suse.de;\n\tnone"],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1WlY09Ylz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 19:59:21 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id CB3443E5389\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 11:59:18 +0200 (CEST)","from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 4A78E3E5390\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 11:58:25 +0200 (CEST)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id E5A5D60085E\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 11:58:24 +0200 (CEST)","from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id B5ECB6A83C\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:19 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A61C6593A3\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:19 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id np8yJzvt6WluUAAAD6G6ig\n (envelope-from <chrubis@suse.cz>)\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:19 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776938300; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=+l5zs/t/McniRjQY7x2ZwhIUtqPP713GS79KWElCCd8=;\n b=RoXfNoq12LyBoVC92ZP5LfBdF3G9I5Sz6p1GuuejG6i3+JMu+zu5PnoPqXZI6Xk+VCSjTT\n ahrPZXZX+uSazRBcy505v+I1Abjc1VMiHwlwy55Krje0gg4XFwsEStrIUpPw5AefX7nS5i\n 5cACxouZ+d8b2rHn6vBWxSXB3HCAYT0=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776938300;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=+l5zs/t/McniRjQY7x2ZwhIUtqPP713GS79KWElCCd8=;\n b=eHIMtvw7xgLX6zJN9ykpTEMyOChJMajg039cgFWcwTxuRNSXbUsvYWrcO/1GU/DSAxfqHM\n kY2XwwKMh6GzWNDg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776938299; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=+l5zs/t/McniRjQY7x2ZwhIUtqPP713GS79KWElCCd8=;\n b=0wfNlcUTW55Box5SaVB/M+E5Zffn7ZaMREjRQNqdXagE4e5aL9srKBdrKkPhBzQRQT9ESV\n s4lrU8BMqNYaOsoccamKrRjsmhUeSMypPSfI0yoEJXJlG4bARrKque1lLhBI6z0v9shAVB\n VzhOzjMSYe58akeJPA2TKSHebyXDC2w=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776938299;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=+l5zs/t/McniRjQY7x2ZwhIUtqPP713GS79KWElCCd8=;\n b=YCVD1C1T1rFcQg5P+DIvcsSOsKXu0X5KsUk63F48mw3kluQUv8bVC0KMvqs5U+hju2s/sm\n EnYpE5u4eOiRK6DA=="],"From":"Cyril Hrubis <chrubis@suse.cz>","To":"ltp@lists.linux.it","Date":"Thu, 23 Apr 2026 11:58:29 +0200","Message-ID":"<20260423095834.11932-4-chrubis@suse.cz>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260423095834.11932-1-chrubis@suse.cz>","References":"<20260423095834.11932-1-chrubis@suse.cz>","MIME-Version":"1.0","X-Spam-Score":"-2.80","X-Spam-Level":"","X-Spamd-Result":"default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000];\n MIME_GOOD(-0.10)[text/plain];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1];\n ARC_NA(0.00)[];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.cz:mid,suse.cz:email,ev.events:url];\n FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];\n MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2];\n TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[];\n PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it];\n RCVD_TLS_ALL(0.00)[]","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-5.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH 3/8] syscalls: Add epoll_wait09","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"That checks that events from recursive epoll are propagated correctly.\n\nSigned-off-by: Cyril Hrubis <chrubis@suse.cz>\n---\n runtest/syscalls                              |   2 +-\n .../kernel/syscalls/epoll_wait/.gitignore     |   1 +\n .../kernel/syscalls/epoll_wait/epoll_wait09.c | 132 ++++++++++++++++++\n 3 files changed, 134 insertions(+), 1 deletion(-)\n create mode 100644 testcases/kernel/syscalls/epoll_wait/epoll_wait09.c","diff":"diff --git a/runtest/syscalls b/runtest/syscalls\nindex 0c6bcdd1a..cf4352d05 100644\n--- a/runtest/syscalls\n+++ b/runtest/syscalls\n@@ -195,7 +195,7 @@ epoll_wait04 epoll_wait04\n epoll_wait05 epoll_wait05\n epoll_wait06 epoll_wait06\n epoll_wait07 epoll_wait07\n-epoll_wait08 epoll_wait08\n+epoll_wait09 epoll_wait09\n \n epoll_pwait01 epoll_pwait01\n epoll_pwait02 epoll_pwait02\ndiff --git a/testcases/kernel/syscalls/epoll_wait/.gitignore b/testcases/kernel/syscalls/epoll_wait/.gitignore\nindex f3b208950..f32ec535b 100644\n--- a/testcases/kernel/syscalls/epoll_wait/.gitignore\n+++ b/testcases/kernel/syscalls/epoll_wait/.gitignore\n@@ -6,3 +6,4 @@ epoll_wait05\n epoll_wait06\n epoll_wait07\n epoll_wait08\n+epoll_wait09\ndiff --git a/testcases/kernel/syscalls/epoll_wait/epoll_wait09.c b/testcases/kernel/syscalls/epoll_wait/epoll_wait09.c\nnew file mode 100644\nindex 000000000..790690884\n--- /dev/null\n+++ b/testcases/kernel/syscalls/epoll_wait/epoll_wait09.c\n@@ -0,0 +1,132 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz>\n+ */\n+\n+/*\\\n+ * Verify that epoll_wait works with nested epoll instances up to the maximum\n+ * nesting depth of 5 allowed by the kernel (EP_MAX_NESTS).\n+ *\n+ * [Algorithm]\n+ *\n+ * - Create a pipe.\n+ * - Build a chain of epoll instances of the given depth where the innermost\n+ *   monitors the pipe read end and each subsequent one monitors the previous.\n+ * - Write data to the pipe.\n+ * - Call epoll_wait on the outermost epoll instance and verify it reports\n+ *   EPOLLIN.\n+ * - Walk the chain inward calling epoll_wait on each level and verify that\n+ *   every level reports EPOLLIN on the expected fd.\n+ * - Read the data from the pipe to drain it.\n+ */\n+\n+#include <sys/epoll.h>\n+\n+#include \"tst_epoll.h\"\n+#include \"tst_test.h\"\n+\n+#define MAX_DEPTH 5\n+\n+static int epfds[MAX_DEPTH];\n+static int fds[2] = {-1, -1};\n+\n+static struct tcase {\n+\tint depth;\n+} tcases[] = {\n+\t{2},\n+\t{3},\n+\t{4},\n+\t{5},\n+};\n+\n+static void run(unsigned int n)\n+{\n+\tstruct tcase *tc = &tcases[n];\n+\tstruct epoll_event ev;\n+\tint prev_fd, i;\n+\tchar buf;\n+\n+\tprev_fd = fds[0];\n+\n+\tfor (i = 0; i < tc->depth; i++) {\n+\t\tepfds[i] = SAFE_EPOLL_CREATE1(0);\n+\n+\t\tev.events = EPOLLIN;\n+\t\tev.data.fd = prev_fd;\n+\n+\t\tSAFE_EPOLL_CTL(epfds[i], EPOLL_CTL_ADD, prev_fd, &ev);\n+\n+\t\tprev_fd = epfds[i];\n+\t}\n+\n+\tSAFE_WRITE(SAFE_WRITE_ALL, fds[1], \"x\", 1);\n+\n+\t/* Walk from outermost to innermost verifying each level */\n+\tfor (i = tc->depth - 1; i >= 0; i--) {\n+\t\tint expected_fd = (i > 0) ? epfds[i - 1] : fds[0];\n+\n+\t\tTEST(epoll_wait(epfds[i], &ev, 1, 1000));\n+\t\tif (TST_RET != 1) {\n+\t\t\ttst_res(TFAIL | TTERRNO,\n+\t\t\t\t\"depth %d/%d: epoll_wait() returned %li, expected 1\",\n+\t\t\t\ttc->depth - i, tc->depth, TST_RET);\n+\t\t\tgoto end;\n+\t\t}\n+\n+\t\tif (ev.data.fd != expected_fd) {\n+\t\t\ttst_res(TFAIL,\n+\t\t\t\t\"depth %d/%d: data.fd %d, expected %d\",\n+\t\t\t\ttc->depth - i, tc->depth,\n+\t\t\t\tev.data.fd, expected_fd);\n+\t\t\tgoto end;\n+\t\t}\n+\n+\t\tif (!(ev.events & EPOLLIN)) {\n+\t\t\ttst_res(TFAIL,\n+\t\t\t\t\"depth %d/%d: events %x, expected EPOLLIN\",\n+\t\t\t\ttc->depth - i, tc->depth, ev.events);\n+\t\t\tgoto end;\n+\t\t}\n+\t}\n+\n+\ttst_res(TPASS, \"epoll_wait() with %d nested levels\", tc->depth);\n+\n+end:\n+\tSAFE_READ(1, fds[0], &buf, 1);\n+\n+\tfor (i = tc->depth - 1; i >= 0; i--) {\n+\t\tif (epfds[i] != -1)\n+\t\t\tSAFE_CLOSE(epfds[i]);\n+\t}\n+\n+}\n+\n+static void setup(void)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < MAX_DEPTH; i++)\n+\t\tepfds[i] = -1;\n+\n+\tSAFE_PIPE(fds);\n+}\n+\n+static void cleanup(void)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < MAX_DEPTH; i++) {\n+\t\tif (epfds[i] != -1)\n+\t\t\tSAFE_CLOSE(epfds[i]);\n+\t}\n+\n+\tSAFE_CLOSE(fds[0]);\n+\tSAFE_CLOSE(fds[1]);\n+}\n+\n+static struct tst_test test = {\n+\t.test = run,\n+\t.setup = setup,\n+\t.cleanup = cleanup,\n+\t.tcnt = ARRAY_SIZE(tcases),\n+};\n","prefixes":["3/8"]}