get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218410,
    "url": "http://patchwork.ozlabs.org/api/patches/2218410/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260401072912.355072-5-huiwen.he@linux.dev/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/projects/12/?format=api",
        "name": "Linux CIFS Client",
        "link_name": "linux-cifs-client",
        "list_id": "linux-cifs.vger.kernel.org",
        "list_email": "linux-cifs@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260401072912.355072-5-huiwen.he@linux.dev>",
    "list_archive_url": null,
    "date": "2026-04-01T07:29:04",
    "name": "[v2,04/12] smb/client: refactor ntstatus_to_dos() to return mapping entry",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d0af07c304e634e16473071eb922b83008eff097",
    "submitter": {
        "id": 93029,
        "url": "http://patchwork.ozlabs.org/api/people/93029/?format=api",
        "name": null,
        "email": "huiwen.he@linux.dev"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260401072912.355072-5-huiwen.he@linux.dev/mbox/",
    "series": [
        {
            "id": 498285,
            "url": "http://patchwork.ozlabs.org/api/series/498285/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=498285",
            "date": "2026-04-01T07:29:08",
            "name": "smb: improve search speed of SMB1 maperror",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498285/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218410/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218410/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10609-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-cifs@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=qSflNCQp;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10609-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev\n header.b=\"qSflNCQp\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.218.175.179",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.dev"
        ],
        "Received": [
            "from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])\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 4flxhC3RGMz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 18:39:23 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 3A544309D5AF\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  1 Apr 2026 07:32:44 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 72E4138F94B;\n\tWed,  1 Apr 2026 07:30:35 +0000 (UTC)",
            "from out-179.mta0.migadu.com (out-179.mta0.migadu.com\n [91.218.175.179])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id F2F2A388E57\n\tfor <linux-cifs@vger.kernel.org>; Wed,  1 Apr 2026 07:30:33 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775028635; cv=none;\n b=skY4OIbUiMYmxI2rSAPnpkc3LeueY28MFllcDuVupnt9vtazVQUxmWq4+fliI+EMN9y/i8zRU3akiYiYgtYBr3IXZLu6w6SiqO6jxUKojI0stAlkatEFIGGXMqZR/YQ0S+UzIiMqHVfw/qS23yLXDo2TgAN0Zlqxd+gDDvINUJw=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775028635; c=relaxed/simple;\n\tbh=DbGkvFwlbrgs+fz42YuEcrFRmqkD3VrsX/Nb79mX91Y=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=L+loQw/ZeMbADKPzbKhUjhyx9nNTCKvpxiVPwJ8MffHHLaO2Q+JIeM+O9N1qYS698fHTXuFcFoMYVuoucZsTQBy7LGkLSAXi1pCohrl/UxOfB6RuN7Tr7dMxyM4d9PVjTQarnbeGCntOSS2w8rnZVY805cMmvr9pBToFRcT4F9U=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev;\n spf=pass smtp.mailfrom=linux.dev;\n dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev\n header.b=qSflNCQp; arc=none smtp.client-ip=91.218.175.179",
        "X-Report-Abuse": "Please report any abuse attempt to abuse@migadu.com and\n include these headers.",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n\tt=1775028632;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=iUo4twWGNV6iwtSZoWncM1mTAfGi4f/KFoB3iiXSk8k=;\n\tb=qSflNCQpCB1Q77KKeuDss8y7fBqIPW6yxfSXGlSzwxmBQ0IX2a/ve+YA1awJs6WW9WSFg2\n\th5v3W+anXEwICEv9ZjXKoD8PXywGMVBf/OI2TYBWH9AGXGxWq19lUf2BgGJFEa/imGi79D\n\toKwwZDJlQAqrg20mXkoy94iHsOYlzjU=",
        "From": "huiwen.he@linux.dev",
        "To": "smfrench@gmail.com,\n\tlinkinjeon@kernel.org,\n\tpc@manguebit.org,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tbharathsm@microsoft.com,\n\tsenozhatsky@chromium.org,\n\tdhowells@redhat.com,\n\tchenxiaosong@kylinos.cn,\n\tchenxiaosong@chenxiaosong.com,\n\ttangyouling@kylinos.cn",
        "Cc": "linux-cifs@vger.kernel.org,\n\tHuiwen He <hehuiwen@kylinos.cn>",
        "Subject": "[PATCH v2 04/12] smb/client: refactor ntstatus_to_dos() to return\n mapping entry",
        "Date": "Wed,  1 Apr 2026 07:29:04 +0000",
        "Message-ID": "<20260401072912.355072-5-huiwen.he@linux.dev>",
        "In-Reply-To": "<20260401072912.355072-1-huiwen.he@linux.dev>",
        "References": "<20260401072912.355072-1-huiwen.he@linux.dev>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-cifs@vger.kernel.org",
        "List-Id": "<linux-cifs.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Migadu-Flow": "FLOW_OUT"
    },
    "content": "From: Huiwen He <hehuiwen@kylinos.cn>\n\nRefactor ntstatus_to_dos() to return a pointer to the mapping entry\ninstead of using output parameters. This allows callers to access all\nfields of the entry directly.\n\nIn map_smb_to_linux_error(), integrate the printing logic directly\nto avoid redundant lookups previously performed by cifs_print_status(),\nwhich is now removed.\n\nSigned-off-by: Huiwen He <hehuiwen@kylinos.cn>\nReviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>\n---\n fs/smb/client/smb1maperror.c | 51 ++++++++++++++----------------------\n 1 file changed, 19 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/fs/smb/client/smb1maperror.c b/fs/smb/client/smb1maperror.c\nindex 53313b39d1de..c906f233ac64 100644\n--- a/fs/smb/client/smb1maperror.c\n+++ b/fs/smb/client/smb1maperror.c\n@@ -116,41 +116,19 @@ static const struct ntstatus_to_dos_err ntstatus_to_dos_map[] = {\n \t{0, 0, 0, NULL}\n };\n \n-/*****************************************************************************\n- Print an error message from the status code\n- *****************************************************************************/\n-static void\n-cifs_print_status(__u32 status_code)\n-{\n-\tint idx = 0;\n-\n-\twhile (ntstatus_to_dos_map[idx].nt_errstr) {\n-\t\tif (ntstatus_to_dos_map[idx].ntstatus == status_code) {\n-\t\t\tpr_notice(\"Status code returned 0x%08x %s\\n\",\n-\t\t\t\t  status_code, ntstatus_to_dos_map[idx].nt_errstr);\n-\t\t\treturn;\n-\t\t}\n-\t\tidx++;\n-\t}\n-\treturn;\n-}\n-\n-\n-static void\n-ntstatus_to_dos(__u32 ntstatus, __u8 *eclass, __u16 *ecode)\n+static const struct ntstatus_to_dos_err *\n+ntstatus_to_dos(__u32 ntstatus)\n {\n \tint i;\n \n \t/* Check nt_errstr to allow mapping of NT_STATUS_OK (0) */\n \tfor (i = 0; ntstatus_to_dos_map[i].nt_errstr; i++) {\n \t\tif (ntstatus == ntstatus_to_dos_map[i].ntstatus) {\n-\t\t\t*eclass = ntstatus_to_dos_map[i].dos_class;\n-\t\t\t*ecode = ntstatus_to_dos_map[i].dos_code;\n-\t\t\treturn;\n+\t\t\treturn &ntstatus_to_dos_map[i];\n \t\t}\n \t}\n-\t*eclass = ERRHRD;\n-\t*ecode = ERRgeneral;\n+\n+\treturn NULL;\n }\n \n int\n@@ -172,11 +150,20 @@ map_smb_to_linux_error(char *buf, bool logErr)\n \t\t/* translate the newer STATUS codes to old style SMB errors\n \t\t * and then to POSIX errors */\n \t\t__u32 err = le32_to_cpu(smb->Status.CifsError);\n-\t\tif (logErr && (err != (NT_STATUS_MORE_PROCESSING_REQUIRED)))\n-\t\t\tcifs_print_status(err);\n-\t\telse if (cifsFYI & CIFS_RC)\n-\t\t\tcifs_print_status(err);\n-\t\tntstatus_to_dos(err, &smberrclass, &smberrcode);\n+\t\tconst struct ntstatus_to_dos_err *map = ntstatus_to_dos(err);\n+\n+\t\tif (map) {\n+\t\t\tif ((logErr && err != NT_STATUS_MORE_PROCESSING_REQUIRED) ||\n+\t\t\t    (cifsFYI & CIFS_RC))\n+\t\t\t\tpr_notice(\"Status code returned 0x%08x %s\\n\",\n+\t\t\t\t\t  map->ntstatus, map->nt_errstr);\n+\n+\t\t\tsmberrclass = map->dos_class;\n+\t\t\tsmberrcode = map->dos_code;\n+\t\t} else {\n+\t\t\tsmberrclass = ERRHRD;\n+\t\t\tsmberrcode = ERRgeneral;\n+\t\t}\n \t} else {\n \t\tsmberrclass = smb->Status.DosError.ErrorClass;\n \t\tsmberrcode = le16_to_cpu(smb->Status.DosError.Error);\n",
    "prefixes": [
        "v2",
        "04/12"
    ]
}