get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2223370,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2223370/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260415071812.1139054-2-dmantipov@yandex.ru/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260415071812.1139054-2-dmantipov@yandex.ru>",
    "list_archive_url": null,
    "date": "2026-04-15T07:18:11",
    "name": "[v5,2/3] ubifs: use strscpy() and kmemdup_nul() where appropriate",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "892f4e05086e1e4982d3566a680b79341e50ceed",
    "submitter": {
        "id": 87610,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/87610/?format=api",
        "name": "Dmitry Antipov",
        "email": "dmantipov@yandex.ru"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260415071812.1139054-2-dmantipov@yandex.ru/mbox/",
    "series": [
        {
            "id": 499932,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499932/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=499932",
            "date": "2026-04-15T07:18:11",
            "name": "[v5,1/3] ubifs: prefer kstrtobool_from_user() over custom helper",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/499932/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223370/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223370/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nz2II7Sl;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=yandex.ru header.i=@yandex.ru header.a=rsa-sha256\n header.s=mail header.b=RIWJfIHz;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)",
            "\n mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net;\n dkim=pass header.i=@yandex.ru"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwXZQ6MHrz1yHM\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 17:19:10 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wCuWY-00000000hwE-47q8;\n\tWed, 15 Apr 2026 07:18:58 +0000",
            "from forward101d.mail.yandex.net\n ([2a02:6b8:c41:1300:1:45:d181:d101])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wCuWU-00000000huM-0ir4\n\tfor linux-mtd@lists.infradead.org;\n\tWed, 15 Apr 2026 07:18:57 +0000",
            "from mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net\n (mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net\n [IPv6:2a02:6b8:c0c:489d:0:640:baa6:0])\n\tby forward101d.mail.yandex.net (Yandex) with ESMTPS id A53EAC00A8;\n\tWed, 15 Apr 2026 10:18:48 +0300 (MSK)",
            "by mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net\n (smtp/Yandex) with ESMTPSA id kIGRDIAS44Y0-Ukwsob9A;\n\tWed, 15 Apr 2026 10:18:48 +0300"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=BpDFnYyDIylL4tsRZvC+C6QpZPfg2hzugbZ9wAQ0qYs=; b=nz2II7SljfjEYh\n\tSAEP2QJx3rwxyHHCpP4hkYJFkah4Tco4P0NiALTDHDlDq4oggD2sRjQWe9mY7dLIKTcGdzM0yoJ9J\n\tuFL2eUgH+4Id0nKNoZQe03oAfNfWT4N9U6sovqwbwat3JZ8p338+oOzqNpA89vdmSg847lCm7CdVB\n\tFUe7Gt70yiw0W+C+2lkrCktIHreogsxeG+8XNkfyBEZ6R7hwT3+8E1/v8OM8EKEgLYpWPaF/yyla2\n\tq46REPICYdYmTpmT+G09yd8HdcE9T7IbhCSDutYxr68H1m34f7q8Zx62uCfnnFiE04/Nq3sVRzSdW\n\thmL/enlB4nb3RvhmjHDw==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;\n\tt=1776237528; bh=i3cKYweERVc9kRhibEcFRYxECpBythVgnpNBLeJIP38=;\n\th=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From;\n\tb=RIWJfIHzPyjg5NBlLM+dkVYeBUn26JgWYDbQQAjBXCJ/ob+abDEZ6U4oDmcalQz7c\n\t z6/CGu85U2zOkELDTv/pdjJWLtNDw9villxnh6Z8dJNKoRbqfGYlyh3EAGUWaQ1t3q\n\t TsDBAU67WRMQmFvHAGADtgdDBWZORPL44dsZuREk="
        ],
        "X-Yandex-Fwd": "1",
        "From": "Dmitry Antipov <dmantipov@yandex.ru>",
        "To": "Zhihao Cheng <chengzhihao1@huawei.com>,\n\tRichard Weinberger <richard@nod.at>",
        "Cc": "linux-mtd@lists.infradead.org,\n\tDmitry Antipov <dmantipov@yandex.ru>",
        "Subject": "[PATCH v5 2/3] ubifs: use strscpy() and kmemdup_nul() where\n appropriate",
        "Date": "Wed, 15 Apr 2026 10:18:11 +0300",
        "Message-ID": "<20260415071812.1139054-2-dmantipov@yandex.ru>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260415071812.1139054-1-dmantipov@yandex.ru>",
        "References": "<20260415071812.1139054-1-dmantipov@yandex.ru>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260415_001854_738386_610413CE ",
        "X-CRM114-Status": "GOOD (  10.91  )",
        "X-Spam-Score": "-2.8 (--)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Go closer to the modern kernel API and use 'strscpy()' and\n    'kmemdup_nul()' over an ad-hoc ensure-to-have-'\\0' quirks where\n appropriate.\n    Signed-off-by: Dmitry Antipov --- v5: switch to fname_len() + 1 to specify\n    strscpy() target buffer size v4: once again to not forget a\n filesystem-native\n    (little) to CPU endian swap v3: fix strscpy() [...]\n Content analysis details:   (-2.8 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/, low\n                             trust\n                             [2a02:6b8:c41:1300:1:45:d181:d101 listed in]\n                             [list.dnswl.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [dmantipov(at)yandex.ru]",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Go closer to the modern kernel API and use 'strscpy()' and 'kmemdup_nul()'\nover an ad-hoc ensure-to-have-'\\0' quirks where appropriate.\n\nSigned-off-by: Dmitry Antipov <dmantipov@yandex.ru>\n---\nv5: switch to fname_len() + 1 to specify strscpy() target buffer size\nv4: once again to not forget a filesystem-native (little) to CPU endian swap\nv3: fix strscpy() usage as noticed by Zhihao\nv2: initial version to join the series\n---\n fs/ubifs/journal.c | 18 ++++++------------\n fs/ubifs/replay.c  |  3 +--\n fs/ubifs/super.c   |  8 ++------\n 3 files changed, 9 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c\nindex 40a95a2fad50..8d7f0843d353 100644\n--- a/fs/ubifs/journal.c\n+++ b/fs/ubifs/journal.c\n@@ -729,8 +729,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,\n \tdent->inum = deletion ? 0 : cpu_to_le64(inode->i_ino);\n \tdent->type = get_dent_type(inode->i_mode);\n \tdent->nlen = cpu_to_le16(fname_len(nm));\n-\tmemcpy(dent->name, fname_name(nm), fname_len(nm));\n-\tdent->name[fname_len(nm)] = '\\0';\n+\tstrscpy(dent->name, fname_name(nm), fname_len(nm) + 1);\n \tset_dent_cookie(c, dent);\n \n \tzero_dent_node_unused(dent);\n@@ -1232,8 +1231,7 @@ int ubifs_jnl_xrename(struct ubifs_info *c, const struct inode *fst_dir,\n \tdent1->inum = cpu_to_le64(fst_inode->i_ino);\n \tdent1->type = get_dent_type(fst_inode->i_mode);\n \tdent1->nlen = cpu_to_le16(fname_len(snd_nm));\n-\tmemcpy(dent1->name, fname_name(snd_nm), fname_len(snd_nm));\n-\tdent1->name[fname_len(snd_nm)] = '\\0';\n+\tstrscpy(dent1->name, fname_name(snd_nm), fname_len(snd_nm) + 1);\n \tset_dent_cookie(c, dent1);\n \tzero_dent_node_unused(dent1);\n \tubifs_prep_grp_node(c, dent1, dlen1, 0);\n@@ -1248,8 +1246,7 @@ int ubifs_jnl_xrename(struct ubifs_info *c, const struct inode *fst_dir,\n \tdent2->inum = cpu_to_le64(snd_inode->i_ino);\n \tdent2->type = get_dent_type(snd_inode->i_mode);\n \tdent2->nlen = cpu_to_le16(fname_len(fst_nm));\n-\tmemcpy(dent2->name, fname_name(fst_nm), fname_len(fst_nm));\n-\tdent2->name[fname_len(fst_nm)] = '\\0';\n+\tstrscpy(dent2->name, fname_name(fst_nm), fname_len(fst_nm) + 1);\n \tset_dent_cookie(c, dent2);\n \tzero_dent_node_unused(dent2);\n \tubifs_prep_grp_node(c, dent2, dlen2, 0);\n@@ -1424,8 +1421,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,\n \tdent->inum = cpu_to_le64(old_inode->i_ino);\n \tdent->type = get_dent_type(old_inode->i_mode);\n \tdent->nlen = cpu_to_le16(fname_len(new_nm));\n-\tmemcpy(dent->name, fname_name(new_nm), fname_len(new_nm));\n-\tdent->name[fname_len(new_nm)] = '\\0';\n+\tstrscpy(dent->name, fname_name(new_nm), fname_len(new_nm) + 1);\n \tset_dent_cookie(c, dent);\n \tzero_dent_node_unused(dent);\n \tubifs_prep_grp_node(c, dent, dlen1, 0);\n@@ -1446,8 +1442,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,\n \t\tdent2->type = DT_UNKNOWN;\n \t}\n \tdent2->nlen = cpu_to_le16(fname_len(old_nm));\n-\tmemcpy(dent2->name, fname_name(old_nm), fname_len(old_nm));\n-\tdent2->name[fname_len(old_nm)] = '\\0';\n+\tstrscpy(dent2->name, fname_name(old_nm), fname_len(old_nm) + 1);\n \tset_dent_cookie(c, dent2);\n \tzero_dent_node_unused(dent2);\n \tubifs_prep_grp_node(c, dent2, dlen2, 0);\n@@ -1897,8 +1892,7 @@ int ubifs_jnl_delete_xattr(struct ubifs_info *c, const struct inode *host,\n \txent->inum = 0;\n \txent->type = get_dent_type(inode->i_mode);\n \txent->nlen = cpu_to_le16(fname_len(nm));\n-\tmemcpy(xent->name, fname_name(nm), fname_len(nm));\n-\txent->name[fname_len(nm)] = '\\0';\n+\tstrscpy(xent->name, fname_name(nm), fname_len(nm) + 1);\n \tzero_dent_node_unused(xent);\n \tubifs_prep_grp_node(c, xent, xlen, 0);\n \ndiff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c\nindex a9a568f4a868..ef6ae63792d1 100644\n--- a/fs/ubifs/replay.c\n+++ b/fs/ubifs/replay.c\n@@ -463,8 +463,7 @@ static int insert_dent(struct ubifs_info *c, int lnum, int offs, int len,\n \tr->sqnum = sqnum;\n \tkey_copy(c, key, &r->key);\n \tfname_len(&r->nm) = nlen;\n-\tmemcpy(nbuf, name, nlen);\n-\tnbuf[nlen] = '\\0';\n+\tstrscpy(nbuf, name, nlen + 1);\n \tfname_name(&r->nm) = nbuf;\n \n \tlist_add_tail(&r->list, &c->replay_list);\ndiff --git a/fs/ubifs/super.c b/fs/ubifs/super.c\nindex 9a77d8b64ffa..048c21271db1 100644\n--- a/fs/ubifs/super.c\n+++ b/fs/ubifs/super.c\n@@ -168,13 +168,11 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)\n \t\tinode->i_op = &ubifs_file_inode_operations;\n \t\tinode->i_fop = &ubifs_file_operations;\n \t\tif (ui->xattr) {\n-\t\t\tui->data = kmalloc(ui->data_len + 1, GFP_NOFS);\n+\t\t\tui->data = kmemdup_nul(ino->data, ui->data_len, GFP_NOFS);\n \t\t\tif (!ui->data) {\n \t\t\t\terr = -ENOMEM;\n \t\t\t\tgoto out_ino;\n \t\t\t}\n-\t\t\tmemcpy(ui->data, ino->data, ui->data_len);\n-\t\t\t((char *)ui->data)[ui->data_len] = '\\0';\n \t\t} else if (ui->data_len != 0) {\n \t\t\terr = 10;\n \t\t\tgoto out_invalid;\n@@ -194,13 +192,11 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)\n \t\t\terr = 12;\n \t\t\tgoto out_invalid;\n \t\t}\n-\t\tui->data = kmalloc(ui->data_len + 1, GFP_NOFS);\n+\t\tui->data = kmemdup_nul(ino->data, ui->data_len, GFP_NOFS);\n \t\tif (!ui->data) {\n \t\t\terr = -ENOMEM;\n \t\t\tgoto out_ino;\n \t\t}\n-\t\tmemcpy(ui->data, ino->data, ui->data_len);\n-\t\t((char *)ui->data)[ui->data_len] = '\\0';\n \t\tbreak;\n \tcase S_IFBLK:\n \tcase S_IFCHR:\n",
    "prefixes": [
        "v5",
        "2/3"
    ]
}