get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2221275,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221275/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260409045629.527019-1-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": "<20260409045629.527019-1-dmantipov@yandex.ru>",
    "list_archive_url": null,
    "date": "2026-04-09T04:56:28",
    "name": "[v4,1/2] ubifs: prefer kstrtobool_from_user() over custom helper",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "40728fecbc9dcce31225268d6fdfcbf3afe54b8e",
    "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/20260409045629.527019-1-dmantipov@yandex.ru/mbox/",
    "series": [
        {
            "id": 499234,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499234/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=499234",
            "date": "2026-04-09T04:56:28",
            "name": "[v4,1/2] ubifs: prefer kstrtobool_from_user() over custom helper",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/499234/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221275/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221275/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=LZSKYwHW;\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=mclK5qVm;\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-78.klg.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 4frnj64MSnz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 14:56:58 +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 1wAhRe-00000009hTI-40vC;\n\tThu, 09 Apr 2026 04:56:46 +0000",
            "from forward102d.mail.yandex.net ([178.154.239.213])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wAhRa-00000009hSY-3eQ8\n\tfor linux-mtd@lists.infradead.org;\n\tThu, 09 Apr 2026 04:56:45 +0000",
            "from mail-nwsmtp-smtp-production-main-78.klg.yp-c.yandex.net\n (mail-nwsmtp-smtp-production-main-78.klg.yp-c.yandex.net\n [IPv6:2a02:6b8:c43:d880:0:640:3563:0])\n\tby forward102d.mail.yandex.net (Yandex) with ESMTPS id 69D2EC0111;\n\tThu, 09 Apr 2026 07:56:36 +0300 (MSK)",
            "by mail-nwsmtp-smtp-production-main-78.klg.yp-c.yandex.net\n (smtp/Yandex) with ESMTPSA id Yu76IE8SJuQ0-v3buwENo;\n\tThu, 09 Apr 2026 07:56:36 +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=DQKlqm+URrbeDRp7q5wm3QE+Ve8CC5TBmEz22fT1b/g=; b=LZSKYwHW72+12b\n\t86X4SHbbJiTiwM02n76Umo0MVtI1Gi35fRKm6+RgT9QayOAGeIxBAv5j3cIOOWpCZjiluoUwdXhOa\n\tKzxUNSAP/9fQHTCigI/s1ccMhl0ZzGQRsPZumgUV8/or8ybTpL4u1bVvcWaXauXhFStTiLwBmmgtU\n\tY4UF9yEv31JSe7zE4ZmZDz/HvQgAKSevC2M20AbM00550ofq/fPrRrgVorbW1zrEluP2sb7NeUAcN\n\tbhmv7J65cEGijzHETmNfUCTs8pReq4rmzVWtCWiAmqwW1S7cXXkft6HOdHpL8Kx0GP3PVDjLXVt4U\n\tAO4fA1UI911fZ8tbS7PQ==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;\n\tt=1775710596; bh=8jYrWOQ1rEq47acNXqtzgaDC3GwdJWMLeILnxWMyA0o=;\n\th=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From;\n\tb=mclK5qVmzfS1/40RJ/H2RSIkFIMTIXv6rrBEtT1RECXV9E+RonxSyS8SvYH792h41\n\t DE3E7aLL5F+WpfZ+gUYyJEdWJlbEH26E0RDSpJn18KVr3yHPxpRBCLeOw+5ektOnUK\n\t fyrwRA4WXrGwefPfD2LvWTcbH4XbxPXSgzhG1U5g="
        ],
        "X-Yandex-Fwd": "1",
        "From": "Dmitry Antipov <dmantipov@yandex.ru>",
        "To": "Zhihao Cheng <chengzhihao1@huawei.com>",
        "Cc": "Richard Weinberger <richard@nod.at>,\n\tlinux-mtd@lists.infradead.org,\n\tDmitry Antipov <dmantipov@yandex.ru>",
        "Subject": "[PATCH v4 1/2] ubifs: prefer kstrtobool_from_user() over custom\n helper",
        "Date": "Thu,  9 Apr 2026 07:56:28 +0300",
        "Message-ID": "<20260409045629.527019-1-dmantipov@yandex.ru>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<5deffdfa-6a99-8205-1f71-ff1f07ce28d1@huawei.com>",
        "References": "<5deffdfa-6a99-8205-1f71-ff1f07ce28d1@huawei.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260408_215643_426182_9453AD53 ",
        "X-CRM114-Status": "GOOD (  14.04  )",
        "X-Spam-Score": "-2.1 (--)",
        "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:  Adjust 'dfs_file_write()' and 'dfs_global_file_write()' to\n    prefer generic 'kstrtobool_from_user()' over an ad-hoc\n 'interpret_user_input()'\n    helper,\n thus making the latter not needed anymore. Reviewed-by: Zhihao Cheng\n    Signed-off-by: Dmitry Antipov --- v3 and upwards: bump version to match\n the\n    series v2: add Reviewed-by: and bump version to match the series ---\n fs/ubifs/debug.c\n    | 44 +++ [...]\n Content analysis details:   (-2.1 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [178.154.239.213 listed in\n sa-accredit.habeas.com]\n  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n                             query to Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                        [178.154.239.213 listed in\n sa-trusted.bondedsender.org]\n  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                           [178.154.239.213 listed in\n bl.score.senderscore.com]\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": "Adjust 'dfs_file_write()' and 'dfs_global_file_write()' to prefer generic\n'kstrtobool_from_user()' over an ad-hoc 'interpret_user_input()' helper,\nthus making the latter not needed anymore.\n\nReviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>\nSigned-off-by: Dmitry Antipov <dmantipov@yandex.ru>\n---\nv3 and upwards: bump version to match the series\nv2: add Reviewed-by: and bump version to match the series\n---\n fs/ubifs/debug.c | 44 ++++++++++----------------------------------\n 1 file changed, 10 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c\nindex 160c16aa7b6e..252cf82012cf 100644\n--- a/fs/ubifs/debug.c\n+++ b/fs/ubifs/debug.c\n@@ -2732,39 +2732,14 @@ static ssize_t dfs_file_read(struct file *file, char __user *u, size_t count,\n \treturn provide_user_output(val, u, count, ppos);\n }\n \n-/**\n- * interpret_user_input - interpret user debugfs file input.\n- * @u: user-provided buffer with the input\n- * @count: buffer size\n- *\n- * This is a helper function which interpret user input to a boolean UBIFS\n- * debugfs file. Returns %0 or %1 in case of success and a negative error code\n- * in case of failure.\n- */\n-static int interpret_user_input(const char __user *u, size_t count)\n-{\n-\tsize_t buf_size;\n-\tchar buf[8];\n-\n-\tbuf_size = min_t(size_t, count, (sizeof(buf) - 1));\n-\tif (copy_from_user(buf, u, buf_size))\n-\t\treturn -EFAULT;\n-\n-\tif (buf[0] == '1')\n-\t\treturn 1;\n-\telse if (buf[0] == '0')\n-\t\treturn 0;\n-\n-\treturn -EINVAL;\n-}\n-\n static ssize_t dfs_file_write(struct file *file, const char __user *u,\n \t\t\t      size_t count, loff_t *ppos)\n {\n \tstruct ubifs_info *c = file->private_data;\n \tstruct ubifs_debug_info *d = c->dbg;\n \tstruct dentry *dent = file->f_path.dentry;\n-\tint val;\n+\tbool val;\n+\tint ret;\n \n \tif (file->f_path.dentry == d->dfs_dump_lprops) {\n \t\tubifs_dump_lprops(c);\n@@ -2781,9 +2756,9 @@ static ssize_t dfs_file_write(struct file *file, const char __user *u,\n \t\treturn count;\n \t}\n \n-\tval = interpret_user_input(u, count);\n-\tif (val < 0)\n-\t\treturn val;\n+\tret = kstrtobool_from_user(u, count, &val);\n+\tif (unlikely(ret))\n+\t\treturn ret;\n \n \tif (dent == d->dfs_chk_gen)\n \t\td->chk_gen = val;\n@@ -2926,11 +2901,12 @@ static ssize_t dfs_global_file_write(struct file *file, const char __user *u,\n \t\t\t\t     size_t count, loff_t *ppos)\n {\n \tstruct dentry *dent = file->f_path.dentry;\n-\tint val;\n+\tbool val;\n+\tint ret;\n \n-\tval = interpret_user_input(u, count);\n-\tif (val < 0)\n-\t\treturn val;\n+\tret = kstrtobool_from_user(u, count, &val);\n+\tif (unlikely(ret))\n+\t\treturn ret;\n \n \tif (dent == dfs_chk_gen)\n \t\tubifs_dbg.chk_gen = val;\n",
    "prefixes": [
        "v4",
        "1/2"
    ]
}