{"id":2227172,"url":"http://patchwork.ozlabs.org/api/patches/2227172/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260423095834.11932-8-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-8-chrubis@suse.cz>","list_archive_url":null,"date":"2026-04-23T09:58:33","name":"[7/8] syscalls: Add epoll_wait12","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"f4e22a55a977444a502ab4ae92da8a7825d376a6","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-8-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/2227172/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2227172/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=jeLFO+Ip;\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=UnVBP4OI;\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=jeLFO+Ip;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=UnVBP4OI;\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-out2.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=jeLFO+Ip;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=UnVBP4OI"],"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 4g1Wmj10QDz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 20:00:21 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 87C193E538A\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 12:00:18 +0200 (CEST)","from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::2])\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 672F83E5397\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 11:58:32 +0200 (CEST)","from smtp-out2.suse.de (smtp-out2.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:2])\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-2.smtp.seeweb.it (Postfix) with ESMTPS id D4CF5600057\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 11:58:31 +0200 (CEST)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id 4BD365BD11\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:21 +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 38E92593A3\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:21 +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 fu38DD3t6Wl4UAAAD6G6ig\n (envelope-from <chrubis@suse.cz>)\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:21 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776938301; 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=WJW+Eiwub+PdlQZSR9BD/f7jTWul0IlWkLwsRBGoSzU=;\n b=jeLFO+IpCkVoP7RxDPVJW/Zir0wGIH1zmQM5VKAee9IOe8D8PvLixrD4dCcrZ95Y8i3Fwv\n MlrpG6s5+HSD8xd3NQ9ki/bc5G+vyxNf1JNLceWHPmXkc+YZ52K0QBwZ6X+bHx8Ji1qXnC\n tyrQn02YThx3b4wZ2pKwQJnmb5jKslE=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776938301;\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=WJW+Eiwub+PdlQZSR9BD/f7jTWul0IlWkLwsRBGoSzU=;\n b=UnVBP4OIEy+zJ1Am09+z64OEBEwWQAqMmBkKFavjullI4aLV6CsjChO33M14TVFopKNbbk\n 52vwabh+AHIm0UAA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776938301; 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=WJW+Eiwub+PdlQZSR9BD/f7jTWul0IlWkLwsRBGoSzU=;\n b=jeLFO+IpCkVoP7RxDPVJW/Zir0wGIH1zmQM5VKAee9IOe8D8PvLixrD4dCcrZ95Y8i3Fwv\n MlrpG6s5+HSD8xd3NQ9ki/bc5G+vyxNf1JNLceWHPmXkc+YZ52K0QBwZ6X+bHx8Ji1qXnC\n tyrQn02YThx3b4wZ2pKwQJnmb5jKslE=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776938301;\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=WJW+Eiwub+PdlQZSR9BD/f7jTWul0IlWkLwsRBGoSzU=;\n b=UnVBP4OIEy+zJ1Am09+z64OEBEwWQAqMmBkKFavjullI4aLV6CsjChO33M14TVFopKNbbk\n 52vwabh+AHIm0UAA=="],"From":"Cyril Hrubis <chrubis@suse.cz>","To":"ltp@lists.linux.it","Date":"Thu, 23 Apr 2026 11:58:33 +0200","Message-ID":"<20260423095834.11932-8-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-Spamd-Result":"default: False [-3.01 / 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)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+];\n TO_MATCH_ENVRCPT_ALL(0.00)[];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[];\n DKIM_TRACE(0.00)[suse.cz:+]; RCVD_COUNT_TWO(0.00)[2];\n FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n TO_DN_NONE(0.00)[];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it];\n RCVD_VIA_SMTP_AUTH(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,\n imap1.dmz-prg2.suse.org:rdns, suse.cz:mid, suse.cz:dkim, suse.cz:email,\n ev.events:url]","X-Rspamd-Action":"no action","X-Spam-Score":"-3.01","X-Spam-Level":"","X-Rspamd-Server":"rspamd1.dmz-prg2.suse.org","X-Rspamd-Queue-Id":"4BD365BD11","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-2.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH 7/8] syscalls: Add epoll_wait12","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":"A test for EPOLLERR when we are waiting to write into a pipe and the\nread end is closed.\n\nSigned-off-by: Cyril Hrubis <chrubis@suse.cz>\n---\n runtest/syscalls                              |   1 +\n .../kernel/syscalls/epoll_wait/.gitignore     |   1 +\n .../kernel/syscalls/epoll_wait/epoll_wait12.c | 112 ++++++++++++++++++\n 3 files changed, 114 insertions(+)\n create mode 100644 testcases/kernel/syscalls/epoll_wait/epoll_wait12.c","diff":"diff --git a/runtest/syscalls b/runtest/syscalls\nindex d286ab7ff..0200a9e13 100644\n--- a/runtest/syscalls\n+++ b/runtest/syscalls\n@@ -199,6 +199,7 @@ epoll_wait07 epoll_wait07\n epoll_wait09 epoll_wait09\n epoll_wait10 epoll_wait10\n epoll_wait11 epoll_wait11\n+epoll_wait12 epoll_wait12\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 57bdf0806..ad890d077 100644\n--- a/testcases/kernel/syscalls/epoll_wait/.gitignore\n+++ b/testcases/kernel/syscalls/epoll_wait/.gitignore\n@@ -9,3 +9,4 @@ epoll_wait08\n epoll_wait09\n epoll_wait10\n epoll_wait11\n+epoll_wait12\ndiff --git a/testcases/kernel/syscalls/epoll_wait/epoll_wait12.c b/testcases/kernel/syscalls/epoll_wait/epoll_wait12.c\nnew file mode 100644\nindex 000000000..facbf60c2\n--- /dev/null\n+++ b/testcases/kernel/syscalls/epoll_wait/epoll_wait12.c\n@@ -0,0 +1,112 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) Linux Test Project, 2026\n+ */\n+\n+/*\\\n+ * Verify that epoll_wait reports EPOLLERR when the read end of a pipe is\n+ * closed while a child process is blocked in epoll_wait on the write end.\n+ *\n+ * [Algorithm]\n+ *\n+ * - Create a pipe and fill it completely so the write end is not writable.\n+ * - Register the write end with an epoll instance for EPOLLOUT.\n+ * - Fork a child that closes its copy of the read end and blocks in\n+ *   epoll_wait waiting for the pipe to become writable.\n+ * - Parent waits for the child to enter sleep state, then closes the read\n+ *   end.\n+ * - The child's epoll_wait should return with EPOLLERR set.\n+ */\n+\n+#include <sys/epoll.h>\n+#include <poll.h>\n+\n+#include \"tst_test.h\"\n+#include \"tst_epoll.h\"\n+\n+static int efd = -1, fds[2] = {-1, -1};\n+\n+static void fill_pipe(int fd)\n+{\n+\tchar buf[4096];\n+\tstruct pollfd pfd = {.fd = fd, .events = POLLOUT};\n+\tint nfd;\n+\n+\tmemset(buf, 'a', sizeof(buf));\n+\n+\tdo {\n+\t\tSAFE_WRITE(SAFE_WRITE_ANY, fd, buf, sizeof(buf));\n+\t\tnfd = poll(&pfd, 1, 0);\n+\t\tif (nfd == -1)\n+\t\t\ttst_brk(TBROK | TERRNO, \"poll()\");\n+\t} while (nfd > 0);\n+}\n+\n+static void run(void)\n+{\n+\tpid_t pid;\n+\n+\tSAFE_PIPE(fds);\n+\tfill_pipe(fds[1]);\n+\n+\tefd = SAFE_EPOLL_CREATE1(0);\n+\n+\tstruct epoll_event ev = {\n+\t\t.events = EPOLLOUT,\n+\t\t.data.fd = fds[1],\n+\t};\n+\n+\tSAFE_EPOLL_CTL(efd, EPOLL_CTL_ADD, fds[1], &ev);\n+\n+\tpid = SAFE_FORK();\n+\tif (!pid) {\n+\t\tSAFE_CLOSE(fds[0]);\n+\n+\t\tTEST(epoll_wait(efd, &ev, 1, 5000));\n+\t\tif (TST_RET != 1) {\n+\t\t\ttst_res(TFAIL | TTERRNO,\n+\t\t\t\t\"epoll_wait() returned %li, expected 1\",\n+\t\t\t\tTST_RET);\n+\t\t\texit(0);\n+\t\t}\n+\n+\t\tif (ev.data.fd != fds[1]) {\n+\t\t\ttst_res(TFAIL, \"epoll.data.fd %d, expected %d\",\n+\t\t\t\tev.data.fd, fds[1]);\n+\t\t\texit(0);\n+\t\t}\n+\n+\t\tif (!(ev.events & EPOLLERR)) {\n+\t\t\ttst_res(TFAIL, \"events %x, EPOLLERR not set\",\n+\t\t\t\tev.events);\n+\t\t\texit(0);\n+\t\t}\n+\n+\t\ttst_res(TPASS,\n+\t\t\t\"epoll_wait() reported EPOLLERR on broken pipe\");\n+\t\texit(0);\n+\t}\n+\n+\tTST_PROCESS_STATE_WAIT(pid, 'S', 0);\n+\tSAFE_CLOSE(fds[0]);\n+\tSAFE_CLOSE(fds[1]);\n+\tSAFE_CLOSE(efd);\n+}\n+\n+static void cleanup(void)\n+{\n+\tif (fds[1] > 0)\n+\t\tSAFE_CLOSE(fds[1]);\n+\n+\tif (fds[0] > 0)\n+\t\tSAFE_CLOSE(fds[0]);\n+\n+\tif (efd > 0)\n+\t\tSAFE_CLOSE(efd);\n+}\n+\n+static struct tst_test test = {\n+\t.test_all = run,\n+\t.cleanup = cleanup,\n+\t.forks_child = 1,\n+};\n","prefixes":["7/8"]}