Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2219176/?format=api
{ "id": 2219176, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2219176/?format=api", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.0/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": "" }, "msgid": "<20260402141839.461257-6-huiwen.he@linux.dev>", "date": "2026-04-02T14:18:31", "name": "[v3,05/13] smb/client: use binary search for NT status to DOS mapping", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a569730464fb08cceb6206e98ec5d96a1c368c9e", "submitter": { "id": 93029, "url": "http://patchwork.ozlabs.org/api/1.0/people/93029/?format=api", "name": null, "email": "huiwen.he@linux.dev" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260402141839.461257-6-huiwen.he@linux.dev/mbox/", "series": [ { "id": 498490, "url": "http://patchwork.ozlabs.org/api/1.0/series/498490/?format=api", "date": "2026-04-02T14:18:28", "name": "smb: improve search speed of SMB1 maperror", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/498490/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219176/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-cifs+bounces-10638-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=L6UiKHbK;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10638-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=\"L6UiKHbK\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.218.175.174", "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 sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\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 4fmkgD1yKdz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 01:26:16 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 665643021C24\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 2 Apr 2026 14:20:06 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id ADC2C3EC2D7;\n\tThu, 2 Apr 2026 14:20:00 +0000 (UTC)", "from out-174.mta0.migadu.com (out-174.mta0.migadu.com\n [91.218.175.174])\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 625153ED12F\n\tfor <linux-cifs@vger.kernel.org>; Thu, 2 Apr 2026 14:19:58 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775139600; cv=none;\n b=Qhnd0w0wiMcS0tCBxJmBUdujx6PLWjmzKnyPuf8pUp9RChSAMzFD1ACklmFQuO2/zcNYIvVZneVy99KMnVjFbhd6Ay9fKLm+LM8te7ZBocAN+XtqzZ6U1rLwThmeM7aUnNBuHM/4gmADBlTjtsoTynS87WthfTmt59mxv45C6FI=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775139600; c=relaxed/simple;\n\tbh=3tP42LjgrF0p2ZaHe/0PXqjz7/XNenqLyogjG7CIvVk=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=p8gKzD7gW6uLk51+QXHygvGklAjGGatE9w5XLZCs2gJfSFliQCK5f97+tMWmYhwQ2ktEprFX/2mb6aSGgIk2saU2oggXyHY/qAA/T53YFGnY1Y9qvVKo1C5emf/YwVrtfUxgLPVjEfHJ9npxFVGiPRDGni/GypcX+IXhxFitfiY=", "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=L6UiKHbK; arc=none smtp.client-ip=91.218.175.174", "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=1775139596;\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=t94Wo4HhNZzETgKd72+S5Nz9NnDhV4hrHd2UwIgu19k=;\n\tb=L6UiKHbKsjhlBqlSPZcVwukZGspVxuOc+AS7joOHTVdSHWiw8yLAHlCHA8gCKjmt2+IV+i\n\tB0n/YaOHdnadmHROU/+IST7EVJ2tXePsVMJEw6C1hlNRwG8rUYlLtyLNnSiO7zTJ5U0AMN\n\tYNhumiGYMzSDCLn+eZmcAmpo+eY0bZo=", "From": "huiwen.he@linux.dev", "To": "smfrench@gmail.com,\n\tlinkinjeon@kernel.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 v3 05/13] smb/client: use binary search for NT status to DOS\n mapping", "Date": "Thu, 2 Apr 2026 14:18:31 +0000", "Message-ID": "<20260402141839.461257-6-huiwen.he@linux.dev>", "In-Reply-To": "<20260402141839.461257-1-huiwen.he@linux.dev>", "References": "<20260402141839.461257-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\nThe ntstatus_to_dos_map[] table is sorted now. Replace the linear search\nwith binary search to improve lookup performance.\n\nAlso remove the sentinel entry as it is no longer needed with ARRAY_SIZE().\n\nSigned-off-by: Huiwen He <hehuiwen@kylinos.cn>\nReviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>\n---\n fs/smb/client/smb1maperror.c | 32 +++++++++++++++++++-------------\n 1 file changed, 19 insertions(+), 13 deletions(-)", "diff": "diff --git a/fs/smb/client/smb1maperror.c b/fs/smb/client/smb1maperror.c\nindex c906f233ac64..fb985d2fc0d9 100644\n--- a/fs/smb/client/smb1maperror.c\n+++ b/fs/smb/client/smb1maperror.c\n@@ -106,6 +106,19 @@ static const struct smb_to_posix_error mapping_table_ERRSRV[] = {\n /*****************************************************************************\n *convert a NT status code to a dos class/code\n *****************************************************************************/\n+\n+static __always_inline int ntstatus_to_dos_cmp(const void *_key, const void *_pivot)\n+{\n+\t__u32 key = *(__u32 *)_key;\n+\tconst struct ntstatus_to_dos_err *pivot = _pivot;\n+\n+\tif (key < pivot->ntstatus)\n+\t\treturn -1;\n+\tif (key > pivot->ntstatus)\n+\t\treturn 1;\n+\treturn 0;\n+}\n+\n /* NT status -> dos error map */\n static const struct ntstatus_to_dos_err ntstatus_to_dos_map[] = {\n /*\n@@ -113,22 +126,15 @@ static const struct ntstatus_to_dos_err ntstatus_to_dos_map[] = {\n * sorted by NT status code (ascending).\n */\n #include \"smb1_mapping_table.c\"\n-\t{0, 0, 0, NULL}\n };\n \n static const struct ntstatus_to_dos_err *\n-ntstatus_to_dos(__u32 ntstatus)\n+search_ntstatus_to_dos_map(__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\treturn &ntstatus_to_dos_map[i];\n-\t\t}\n-\t}\n-\n-\treturn NULL;\n+\treturn __inline_bsearch(&ntstatus, ntstatus_to_dos_map,\n+\t\t\t\tARRAY_SIZE(ntstatus_to_dos_map),\n+\t\t\t\tsizeof(struct ntstatus_to_dos_err),\n+\t\t\t\tntstatus_to_dos_cmp);\n }\n \n int\n@@ -150,7 +156,7 @@ 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\tconst struct ntstatus_to_dos_err *map = ntstatus_to_dos(err);\n+\t\tconst struct ntstatus_to_dos_err *map = search_ntstatus_to_dos_map(err);\n \n \t\tif (map) {\n \t\t\tif ((logErr && err != NT_STATUS_MORE_PROCESSING_REQUIRED) ||\n", "prefixes": [ "v3", "05/13" ] }