Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218417/?format=api
{ "id": 2218417, "url": "http://patchwork.ozlabs.org/api/patches/2218417/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260401072912.355072-7-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-7-huiwen.he@linux.dev>", "list_archive_url": null, "date": "2026-04-01T07:29:06", "name": "[v2,06/12] smb/client: check if ntstatus_to_dos_map is sorted", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "badffc70db3b25ce505b2dbaa6821bb1dbd48632", "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-7-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/2218417/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218417/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10611-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=KxbMaLVS;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10611-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=\"KxbMaLVS\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.218.175.189", "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\n [IPv6:2600:3c09:e001:a7::12fc:5321])\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 4flxjv4btgz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 18:40:51 +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 C577E30714F1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Apr 2026 07:33:28 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C9D3B3921E0;\n\tWed, 1 Apr 2026 07:30:41 +0000 (UTC)", "from out-189.mta0.migadu.com (out-189.mta0.migadu.com\n [91.218.175.189])\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 B8B8E391E43\n\tfor <linux-cifs@vger.kernel.org>; Wed, 1 Apr 2026 07:30:39 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775028641; cv=none;\n b=OCvqEOhmsO9ysUCtIbDb3OUOTMYVrrWZDpSs+Wmmo+FElmAlXi7gWGKf0H0D4PVDfmd6L8QDvbaxPf5XJAwBV/7hvT8Ng7COe1qicASO6tzrxlJWqytoy21tsQf+jZdxi6wjQobZ0YOKkIg4pV84jktwkRgAaSdeeeZVO3I31js=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775028641; c=relaxed/simple;\n\tbh=37s9BAMChlsw1vd8Vht5Td0zZB01i1HA3cEULgDTxDs=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=FPOoKU0MiOsrB32ERTlks8qs+xQNm1ztjiIWLdX0gWfcTE0TW0E9OCALm0le1I4yh+jO4+wj4BZoGleFGnPCiGb3w/ueOx4Vw+RJAJWPEX0MAPw+UTA+OOBqMOHUIwD+fdHKjV6H3Ux7T0zRmM72IcDyDymtHpcWQhCbyKcaY+Y=", "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=KxbMaLVS; arc=none smtp.client-ip=91.218.175.189", "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=1775028638;\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=aUhnCZpKE2DPEEh//Dt0gZgFhg0CqKS9OPgHq0m9bbc=;\n\tb=KxbMaLVS9y9GboBT2Uh9Ssnh6DTAnYYAZEM8gS1hcOsKfNkaDdXN8F3zjPbZJk+tRs92iv\n\tMRl5Vpk6+HldLSm0SG1h1imDsdDgAsLuNEh6nxYoAua2DQQ5R9X6409hSGiTE/3fEy6h75\n\tq42YJThtnI+m7Ubnhp2kHK+mHRHduq0=", "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", "Subject": "[PATCH v2 06/12] smb/client: check if ntstatus_to_dos_map is sorted", "Date": "Wed, 1 Apr 2026 07:29:06 +0000", "Message-ID": "<20260401072912.355072-7-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: Youling Tang <tangyouling@kylinos.cn>\n\nAlthough the array is sorted at build time, verify the ordering again\nwhen cifs.ko is loaded to avoid potential regressions introduced by\nfuture script changes.\n\nWe are going to define 3 functions to check the sort results, introduce the\nmacro DEFINE_CHECK_SORT_FUNC() to reduce duplicate code.\n\nSigned-off-by: Youling Tang <tangyouling@kylinos.cn>\nReviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>\n---\n fs/smb/client/cifsfs.c | 6 ++++++\n fs/smb/client/smb1maperror.c | 32 ++++++++++++++++++++++++++++++++\n fs/smb/client/smb1proto.h | 1 +\n 3 files changed, 39 insertions(+)", "diff": "diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c\nindex f4bed8d4a072..0541706c36c5 100644\n--- a/fs/smb/client/cifsfs.c\n+++ b/fs/smb/client/cifsfs.c\n@@ -1915,6 +1915,12 @@ init_cifs(void)\n {\n \tint rc = 0;\n \n+#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY\n+\trc = smb1_init_maperror();\n+\tif (rc)\n+\t\treturn rc;\n+#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */\n+\n \trc = smb2_init_maperror();\n \tif (rc)\n \t\treturn rc;\ndiff --git a/fs/smb/client/smb1maperror.c b/fs/smb/client/smb1maperror.c\nindex fb985d2fc0d9..0a945f9bf8de 100644\n--- a/fs/smb/client/smb1maperror.c\n+++ b/fs/smb/client/smb1maperror.c\n@@ -256,3 +256,35 @@ map_and_check_smb_error(struct TCP_Server_Info *server,\n \n \treturn rc;\n }\n+\n+#define DEFINE_CHECK_SORT_FUNC(__array, __field)\t\t\t\\\n+static int __array ## _is_sorted(void)\t\t\t\t\t\\\n+{\t\t\t\t\t\t\t\t\t\\\n+\tunsigned int i;\t\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t/* Check whether the array is sorted in ascending order */\t\\\n+\tfor (i = 1; i < ARRAY_SIZE(__array); i++) {\t\t\t\\\n+\t\tif (__array[i].__field >=\t\t\t\t\\\n+\t\t __array[i - 1].__field)\t\t\t\t\\\n+\t\t\tcontinue;\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tpr_err(#__array \" array order is incorrect\\n\");\t\t\\\n+\t\treturn -EINVAL;\t\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\treturn 0;\t\t\t\t\t\t\t\\\n+}\n+\n+/* ntstatus_to_dos_map_is_sorted */\n+DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus);\n+\n+int __init smb1_init_maperror(void)\n+{\n+\tint rc;\n+\n+\trc = ntstatus_to_dos_map_is_sorted();\n+\tif (rc)\n+\t\treturn rc;\n+\n+\treturn rc;\n+}\ndiff --git a/fs/smb/client/smb1proto.h b/fs/smb/client/smb1proto.h\nindex 42569bbcf6fd..dd98d04e837a 100644\n--- a/fs/smb/client/smb1proto.h\n+++ b/fs/smb/client/smb1proto.h\n@@ -234,6 +234,7 @@ int cifs_verify_signature(struct smb_rqst *rqst,\n * smb1maperror.c\n */\n int map_smb_to_linux_error(char *buf, bool logErr);\n+int smb1_init_maperror(void);\n int map_and_check_smb_error(struct TCP_Server_Info *server,\n \t\t\t struct mid_q_entry *mid, bool logErr);\n \n", "prefixes": [ "v2", "06/12" ] }