get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2224022/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2224022,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2224022/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260416-stream_refactoring-v2-6-8321b1ec6f68@suse.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/59/?format=api",
        "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": ""
    },
    "msgid": "<20260416-stream_refactoring-v2-6-8321b1ec6f68@suse.com>",
    "date": "2026-04-16T14:33:40",
    "name": "[v2,6/7] fs: rewrite stream04 test using new API",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "355365f46a3d36ddd7bf695fbfb35ef65555ab94",
    "submitter": {
        "id": 83220,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/83220/?format=api",
        "name": "Andrea Cervesato",
        "email": "andrea.cervesato@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260416-stream_refactoring-v2-6-8321b1ec6f68@suse.com/mbox/",
    "series": [
        {
            "id": 500172,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500172/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=500172",
            "date": "2026-04-16T14:33:35",
            "name": "Rewrite fs stream testing suite",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/500172/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224022/comments/",
    "check": "warning",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224022/checks/",
    "tags": {},
    "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.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=tuhPFKJk;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.de\n header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=lwwIwESY;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa\n header.b=tuhPFKJk;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=lwwIwESY;\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 dkim=pass header.d=suse.de header.s=susede2_rsa header.b=tuhPFKJk;\n dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=lwwIwESY"
        ],
        "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 4fxLCq2nyDz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 00:35:51 +1000 (AEST)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 2D3AB3E2976\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 16:35:49 +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 E92553E4B09\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 16:33:54 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id A5E2A6002D4\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 16:33:53 +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-out1.suse.de (Postfix) with ESMTPS id D63D26A7FE;\n Thu, 16 Apr 2026 14:33:37 +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 93C08593A9;\n Thu, 16 Apr 2026 14:33:37 +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 2HrqIUHz4GniGQAAD6G6ig\n (envelope-from <andrea.cervesato@suse.de>); Thu, 16 Apr 2026 14:33:37 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776350017;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=u+olZ5vNGu2mzeqk3yRkvWezTeJ03pdauVYc17ES0s8=;\n b=tuhPFKJkW81JBtICFvUoq7H8qpJZ0qtjPZN9FZ+9MESj1XyJ6NWjhakKL5VcC95Qn4ctr1\n cVrMgpS0d8OuSwRAX6cwoU4Nqe2SQt/uqrCGK/Hb2OzSWjlfMk0zFnQ6MJIGkvhzGJJO1t\n TbCVN9MhuLf6ypRR03XD+Siku6CSpdM=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776350017;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=u+olZ5vNGu2mzeqk3yRkvWezTeJ03pdauVYc17ES0s8=;\n b=lwwIwESYUw1CLJ4ex6WW5GM0KOTQK5gBsEQsBFwBs0QyK3rrdiTUmPe2H7hwf5Iu8Zn8Hv\n +dLrTMuFQLKn2cBQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776350017;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=u+olZ5vNGu2mzeqk3yRkvWezTeJ03pdauVYc17ES0s8=;\n b=tuhPFKJkW81JBtICFvUoq7H8qpJZ0qtjPZN9FZ+9MESj1XyJ6NWjhakKL5VcC95Qn4ctr1\n cVrMgpS0d8OuSwRAX6cwoU4Nqe2SQt/uqrCGK/Hb2OzSWjlfMk0zFnQ6MJIGkvhzGJJO1t\n TbCVN9MhuLf6ypRR03XD+Siku6CSpdM=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776350017;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=u+olZ5vNGu2mzeqk3yRkvWezTeJ03pdauVYc17ES0s8=;\n b=lwwIwESYUw1CLJ4ex6WW5GM0KOTQK5gBsEQsBFwBs0QyK3rrdiTUmPe2H7hwf5Iu8Zn8Hv\n +dLrTMuFQLKn2cBQ=="
        ],
        "From": "Andrea Cervesato <andrea.cervesato@suse.de>",
        "Date": "Thu, 16 Apr 2026 16:33:40 +0200",
        "MIME-Version": "1.0",
        "Message-Id": "<20260416-stream_refactoring-v2-6-8321b1ec6f68@suse.com>",
        "References": "<20260416-stream_refactoring-v2-0-8321b1ec6f68@suse.com>",
        "In-Reply-To": "<20260416-stream_refactoring-v2-0-8321b1ec6f68@suse.com>",
        "To": "Linux Test Project <ltp@lists.linux.it>",
        "X-Mailer": "b4 0.14.2",
        "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1776350016; l=5805;\n i=andrea.cervesato@suse.com; s=20251210; h=from:subject:message-id;\n bh=N6rxdNQNV9FWtt2vJznpNk+qGRCaEuy4xtyzdTZtxVU=;\n b=lLf99qlK6FXjYqqMR6DWy4XUKHotQO5knWPygzVxWutp8g/F3JmhRk5MLTA4Ks8ukGTF0hqT7\n iG0/Gi8bah6CUsRQG3/JSieleK6jbdB5drOqNhvVt9oUYoDCC6+OvRh",
        "X-Developer-Key": "i=andrea.cervesato@suse.com; a=ed25519;\n pk=zKY+6GCauOiuHNZ//d8PQ/UL4jFCTKbXrzXAOQSLevI=",
        "X-Rspamd-Action": "no action",
        "X-Rspamd-Server": "rspamd2.dmz-prg2.suse.org",
        "X-Spamd-Result": "default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n RCVD_VIA_SMTP_AUTH(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n MIME_TRACE(0.00)[0:+]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim];\n RCVD_TLS_ALL(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[];\n FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:mid,suse.com:email,suse.cz:email];\n TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n URIBL_BLOCKED(0.00)[suse.de:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:mid,suse.com:email,suse.cz:email];\n DKIM_TRACE(0.00)[suse.de:+]",
        "X-Rspamd-Queue-Id": "D63D26A7FE",
        "X-Spam-Score": "-4.51",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,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 v2 6/7] fs: rewrite stream04 test using new API",
        "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": "From: Andrea Cervesato <andrea.cervesato@suse.com>\n\nOld LTP API is deprecated. Convert stream04 to new tst_test.h-based\nAPI, verifying that fwrite() appends data and fread() returns the\ncorrect content.\n\nReviewed-by: Cyril Hrubis <chrubis@suse.cz>\nSigned-off-by: Andrea Cervesato <andrea.cervesato@suse.com>\n---\n testcases/kernel/fs/stream/stream04.c | 147 +++++++++-------------------------\n 1 file changed, 40 insertions(+), 107 deletions(-)",
    "diff": "diff --git a/testcases/kernel/fs/stream/stream04.c b/testcases/kernel/fs/stream/stream04.c\nindex 3dc679151a6a81aab8c713605c258fae2c2b3adf..560792f062f3bbb0fcb9164ffd9095803fe6c4fe 100644\n--- a/testcases/kernel/fs/stream/stream04.c\n+++ b/testcases/kernel/fs/stream/stream04.c\n@@ -1,124 +1,57 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n /*\n+ * Copyright (c) International Business Machines  Corp., 2002\n+ *\tported from SPIE, section2/filesuite/stream4.c, by Airong Zhang\n  *\n- *   Copyright (c) International Business Machines  Corp., 2002\n- *\n- *   This program is free software;  you can redistribute it and/or modify\n- *   it under the terms of the GNU General Public License as published by\n- *   the Free Software Foundation; either version 2 of the License, or\n- *   (at your option) any later version.\n- *\n- *   This program is distributed in the hope that it will be useful,\n- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of\n- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\n- *   the GNU General Public License for more details.\n- *\n- *   You should have received a copy of the GNU General Public License\n- *   along with this program;  if not, write to the Free Software\n- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n+ * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com>\n  */\n \n-/* Ported from SPIE, section2/iosuite/stream4.c, by Airong Zhang */\n-\n-/*======================================================================\n-\t=================== TESTPLAN SEGMENT ===================\n->KEYS:  < fwrite() fread()\n->WHAT:  < 1) Ensure fwrite appends data to stream.\n-\t< 2) Ensure fread and fwrite return values are valid.\n->HOW:   < 1) Open a file, write to it, and then check it.\n-\t< 2) Fwrite a know quanity, check return value.\n-\t<    Fread a know quanity, check return value.\n->BUGS:  <\n-======================================================================*/\n-\n-#include <stdio.h>\n-#include <errno.h>\n-#include <fcntl.h>\n-#include <sys/types.h>\n-#include <sys/stat.h>\n-#include \"test.h\"\n-\n-char *TCID = \"stream04\";\n-int TST_TOTAL = 1;\n-int local_flag;\n+/*\\\n+ * Ensure that `fwrite()` is appending data to stream and `fread()`\n+ * `fwrite()` are returning the right data.\n+ */\n \n-#define PASSED 1\n-#define FAILED 0\n+#include \"tst_test.h\"\n+#include \"tst_safe_stdio.h\"\n \n-char progname[] = \"stream04()\";\n-char tempfile1[40] = \"\";\n-long ftell();\n+#define FILENAME \"ltp_file\"\n+#define DATA \"abcdefghijklmnopqrstuvwxyz\"\n+#define DATASIZE sizeof(DATA)\n \n-/* XXX: add setup and cleanup */\n+static char *data;\n+static char *buff;\n \n-/*--------------------------------------------------------------------*/\n-int main(int ac, char *av[])\n+static void run(void)\n {\n \tFILE *stream;\n-\tchar *junk = \"abcdefghijklmnopqrstuvwxyz\";\n-\tchar *inbuf;\n-\tint ret;\n \n-\tint lc;\n+\tmemset(buff, 0, DATASIZE);\n \n-\t/*\n-\t * parse standard options\n-\t */\n-\ttst_parse_opts(ac, av, NULL, NULL);\n-\ttst_tmpdir();\n-\tfor (lc = 0; TEST_LOOPING(lc); lc++) {\n+\tstream = SAFE_FOPEN(FILENAME, \"a+\");\n+\tTST_EXP_EQ_LI(fwrite(data, 1, DATASIZE, stream), DATASIZE);\n+\tSAFE_FCLOSE(stream);\n \n-\t\tlocal_flag = PASSED;\n+\tstream = SAFE_FOPEN(FILENAME, \"r+\");\n+\tTST_EXP_EQ_LI(fread(buff, 1, DATASIZE, stream), DATASIZE);\n+\tSAFE_FCLOSE(stream);\n \n-\t\tsprintf(tempfile1, \"stream04.%d\", getpid());\n-\t/*--------------------------------------------------------------------*/\n-\t\t//block0:\n-\t\tif ((stream = fopen(tempfile1, \"a+\")) == NULL) {\n-\t\t\ttst_brkm(TFAIL | TERRNO, tst_rmdir, \"fopen(%s) a+ failed\",\n-\t\t\t\t tempfile1);\n-\t\t}\n-\t\t/* write something and check */\n-\t\tif ((ret =\n-\t\t     fwrite(junk, sizeof(*junk), strlen(junk), stream)) == 0) {\n-\t\t\ttst_brkm(TFAIL, tst_rmdir, \"fwrite failed: %s\",\n-\t\t\t\t strerror(errno));\n-\t\t}\n+\tSAFE_UNLINK(FILENAME);\n \n-\t\tif ((size_t) ret != strlen(junk)) {\n-\t\t\ttst_resm(TFAIL,\n-\t\t\t\t \"strlen(junk) = %zi != return value from fwrite = %zi\",\n-\t\t\t\t strlen(junk), ret);\n-\t\t\tlocal_flag = FAILED;\n-\t\t}\n+\tTST_EXP_EQ_STRN(data, buff, DATASIZE);\n+}\n \n-\t\tfclose(stream);\n-\t\tif ((stream = fopen(tempfile1, \"r+\")) == NULL) {\n-\t\t\ttst_brkm(TFAIL, tst_rmdir, \"fopen(%s) r+ failed: %s\", tempfile1,\n-\t\t\t\t strerror(errno));\n-\t\t}\n-\t\tif ((inbuf = malloc(strlen(junk))) == 0) {\n-\t\t\ttst_brkm(TBROK, tst_rmdir, \"test failed because of malloc: %s\",\n-\t\t\t\t strerror(errno));\n-\t\t}\n-\t\tif ((ret =\n-\t\t     fread(inbuf, sizeof(*junk), strlen(junk), stream)) == 0) {\n-\t\t\ttst_brkm(TFAIL, tst_rmdir, \"fread failed: %s\",\n-\t\t\t\t strerror(errno));\n-\t\t}\n-\t\tif ((size_t) ret != strlen(junk)) {\n-\t\t\ttst_resm(TFAIL,\n-\t\t\t\t \"strlen(junk) = %zi != return value from fread = %zi\",\n-\t\t\t\t strlen(junk), ret);\n-\t\t\tlocal_flag = FAILED;\n-\t\t}\n-\t\tfclose(stream);\n-\t\tif (local_flag == PASSED) {\n-\t\t\ttst_resm(TPASS, \"Test passed.\");\n-\t\t} else {\n-\t\t\ttst_resm(TFAIL, \"Test failed.\");\n-\t\t}\n-\t/*--------------------------------------------------------------------*/\n-\t\tunlink(tempfile1);\n-\t}\t\t\t/* end for */\n-\ttst_rmdir();\n-\ttst_exit();\n+static void setup(void)\n+{\n+\tmemcpy(data, DATA, DATASIZE);\n }\n+\n+static struct tst_test test = {\n+\t.test_all = run,\n+\t.setup = setup,\n+\t.needs_tmpdir = 1,\n+\t.bufs = (struct tst_buffers []) {\n+\t\t{&data, .size = DATASIZE},\n+\t\t{&buff, .size = DATASIZE},\n+\t\t{},\n+\t},\n+};\n",
    "prefixes": [
        "v2",
        "6/7"
    ]
}