From patchwork Tue Dec 3 10:31:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 13892099 Received: from outbound-ip168b.ess.barracuda.com (outbound-ip168b.ess.barracuda.com [209.222.82.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 030A01E22FC; Tue, 3 Dec 2024 10:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=209.222.82.102 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733221905; cv=fail; b=nxNYy/Q927wVzHHFXJXxtPTPEl9dpLHwWK3aCVMxeQIGks6Lhu3XCJktnJgEiIR+qMSKZO7t1AddF/0R3Yc+gUhRlyaHQNdUx+tqnrds6EYBM038Sn8yampEF2sF6PukFjvs70uehYJ85Hi25Z46F+h7ZjInZ8y+xgDiw5jEl9w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733221905; c=relaxed/simple; bh=nHOmP131y8Oa0pNAcfAJzQe30Jz/Aighg/q+swsXXwk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=buDmVRU8etU/urTEKOkL5xWrLC/Fj6NsO4eBkFR+sU+VSFIQO0XXZn35ufTIfFfprm4p0bZIwdLChJQcsD/okh5EkA8MiGgKUXwCPrkxhmsSUWZ+GvRCKQKghJvhhR08fldbT/qrSTRRzUHCQRSVYN5to/6uh8gYKRE3am5Q2xY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ddn.com; spf=pass smtp.mailfrom=ddn.com; dkim=pass (1024-bit key) header.d=ddn.com header.i=@ddn.com header.b=1z6U+VJ2; arc=fail smtp.client-ip=209.222.82.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ddn.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ddn.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ddn.com header.i=@ddn.com header.b="1z6U+VJ2" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by mx-outbound43-165.us-east-2c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 03 Dec 2024 10:31:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dmMDBqwW1p1iQDTdmZn7ydxhNfhdmOyaIVuwGcGuX3WGRV6WfZuc31AeR9fqRO2sXh5bGo+OTY+RNuq8VRnLD5gHhQ/GNeO7Mxe++Ei3Mow0CavEJMcesBEaXPTuj46cUweqqVVYT7kgNoqJPT+BZ7eeBhR5CzUz2bBfXb0reeoXi696t5anDI7ObCY9TZoCnyxdORynx6EC5s9Zk5sev76z7Zj70dCN6a3ngMTes07ZPWeaGmgnZ09DMAGyepFauF62PCsvq9q4XKUNvsfqRQIPp6qTVpYuElqHCelRJS7kv29nZzTh2/4nzKPvMAbIteffthVR+kAFPpKSOgqySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wVm4H8RXRaqZ8LBjd2ZCTdPtiLPehx//xhmLmyaFlEE=; b=ina2YTmhmwDi1oCxjTENhC3Dz6IN7CAxOhxl4tAfMx85kXZ+Fbsq6rj7TugPILvOSPzMVS79pzaWp1+oTsYCEoLnu8IzjFO6ZtscfUoXiWm+PvhtKROJ69enaMR6CiUtF1fSjlb6RSeWyS6ByUMV3lO9MvR1SVEy0S+bthYORxeayjY7PhW/uV6U01efwFhbjwS5oSasXYao5fwpXYaC2DzDfAqNmIIEO9W7Bkw6lM/tXaNo2fguFk+7a8YRrWp8MdHXDOpRjKqyJTA+TQpl46gTiwLWuIQ1eDuXJzN5x/tr8R27JukX7kYdn+1kvPQ43ZaOSrx9WVD1AqTDn2MKRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 50.222.100.11) smtp.rcpttodomain=ddn.com smtp.mailfrom=ddn.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ddn.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddn.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wVm4H8RXRaqZ8LBjd2ZCTdPtiLPehx//xhmLmyaFlEE=; b=1z6U+VJ2fSHHN1WCrLUMeXQUHHk449npu6OGEVvkPomK9LkkAxJ4Jtb+x85mObt21keZODnglEoXyFE9RpIz2wiJ16u+ZZKKiWs6kgqfwCMXZvZGTlxhkqxSXq7Mr2uXkJoWstS7d2pv2czi762mlX4LJA3zurFjUg99zgm226g= Received: from CH0PR13CA0005.namprd13.prod.outlook.com (2603:10b6:610:b1::10) by CO6PR19MB5402.namprd19.prod.outlook.com (2603:10b6:303:149::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Tue, 3 Dec 2024 10:31:07 +0000 Received: from CH1PEPF0000A345.namprd04.prod.outlook.com (2603:10b6:610:b1:cafe::a0) by CH0PR13CA0005.outlook.office365.com (2603:10b6:610:b1::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.9 via Frontend Transport; Tue, 3 Dec 2024 10:31:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 50.222.100.11) smtp.mailfrom=ddn.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ddn.com; Received-SPF: Pass (protection.outlook.com: domain of ddn.com designates 50.222.100.11 as permitted sender) receiver=protection.outlook.com; client-ip=50.222.100.11; helo=uww-mrp-01.datadirectnet.com; pr=C Received: from uww-mrp-01.datadirectnet.com (50.222.100.11) by CH1PEPF0000A345.mail.protection.outlook.com (10.167.244.8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Tue, 3 Dec 2024 10:31:06 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 09A2E2D; Tue, 3 Dec 2024 10:31:05 +0000 (UTC) From: Bernd Schubert Date: Tue, 03 Dec 2024 11:31:05 +0100 Subject: [PATCH v2] io_uring: Change res2 parameter type in io_uring_cmd_done Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241203-io_uring_cmd_done-res2-as-u64-v2-1-5e59ae617151@ddn.com> X-B4-Tracking: v=1; b=H4sIAOjdTmcC/42NTQrCMBBGr1Jm7Yj5wVRX3kNKicmknUUTSWxRS u9u7AncfPC+xXsrFMpMBa7NCpkWLpxiBXlowI02DoTsK4M8SS3qIKd+zhyH3k2+9ykSZioSbcH 5rFEKYzVp87ioANXxzBT4vfvvXeWRyyvlz55bxO/917wIFGh0UEq1rVO+vXkfjy5N0G3b9gXyC z3GyAAAAA== X-Change-ID: 20241202-io_uring_cmd_done-res2-as-u64-217a4e47b93f To: Jens Axboe , Pavel Begunkov , Kanchan Joshi Cc: io-uring@vger.kernel.org, stable@vger.kernel.org, Li Zetao , Bernd Schubert X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733221865; l=2910; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=nHOmP131y8Oa0pNAcfAJzQe30Jz/Aighg/q+swsXXwk=; b=0U6Vw6jig85BFWmh3BSXWa7em1TjIOR0bhui/6Y+pU7E+mEQLkmrrPQZ6UKEAWIRyf2JYnMBC XEvB3vBqXisBPKNwTeKWFKVAYbU0SpYWmZcps2N15ENRXRHztoP+2Au X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A345:EE_|CO6PR19MB5402:EE_ X-MS-Office365-Filtering-Correlation-Id: d2c9a0a2-414a-4e11-77a9-08dd138598b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?5tlN2EFjg0S+0aSw/70oRVKGPyxtxJa?= =?utf-8?q?BJiRszVEKPZTxr/HUAJ+6/YmY50go2Wc9oZcT9qkQmN7+tfIECTN1qQCEvnmIA2W4?= =?utf-8?q?B5mcTvOHOg0EilvHQK/XerTPn1VEwGt3r7ELrBYIiHemZ38jvnUjwtCpOZJZwIph3?= =?utf-8?q?9jPrLeEWeeBRgpyQOL5QSwvS5sKzb2shrqDJO0Fr7JjfyK6OntE4AwHKmByzJn7hP?= =?utf-8?q?eajDeqI07yPgaI3S6ehBtO0iTHiBeWUANYo3w3uePhXZcfTpp4gqED/5OqiBe7Lx2?= =?utf-8?q?qUP/v4C6LdvZ0do9KuzamOy52rLO/hRY0xJ8g0P3XUdjwQbK5XugvdFMeOIxIpxYF?= =?utf-8?q?wA++ili1usW6S20VsDCvqavZIfB30UYF+rHIwe8wP+7tglo4tGzkNjbW6vOjpT6rD?= =?utf-8?q?cHag3E+MTCOrAut2iQi1xcSvSkKpJqGMakKCaVkmmGcTeB0x3iYLAOR53KTOLSq0r?= =?utf-8?q?mi17J/lvbAEsVSU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n0fmQD0hAONSTVvVfEyezQCZk1+S9oPDs3X9C0Wv3usl?= =?utf-8?q?Enyi18U+lz2?= X-Forefront-Antispam-Report: CIP:50.222.100.11;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:uww-mrp-01.datadirectnet.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: v3txr2d348mNjUEUZOxByHvdmNznyBC19QKedNgpOEzHz4T0PLPRP3ya6I9s8MGXVLxqvEzcGDy9Q7Kf0nKgTVV52KMv/zr9cMUwerzAwCQSAoAJajGsdYHrivrLD57lZcbZdn+pcHDUdHqJ/LAoX9Nk7VsPnHI0HAk/h4KSYqgemk1Inkg6lwibqRSI5Unh7ZFyn3dLfDGmPB8j4Nm8SWchhnUC69huadR6caV0LdLK77lN/Yp1WhIU2KbeD8f4Si+S1AjQ/QaKx/wEhntHq2gC4jV/NWTaD3L0Q7FqYXtpIPLfYcwrhZKM31gUnpq9HUr+CaaN/4jhnZm2MXFWaNSWiokKFWRcSFMIWTkuICPdwc4wd9r1YKkWO1nHAeC59oKkNiXIGkmkwKsVVJuk0U1RY+s+Sy8iICJaK18kgZbDel0FBd871jIMM1ADIaZJ87gDx2xkZcgmg0sXSPWs4hieocjRAwmrkiO1xW68zcKN0aLA9F9rGG/O94QXxz/cwFlx+vxNn1c5mR7P6mNUe2FyFuaR73Sv2bdxAhWwtSgpdO0eKcM15FUS3HdAbUCMoQW7vGTQrn1evcvEJxe0YJ7kCpShNSemn/4eDrKoIeHUJDVzH+Imw0U9Wt5pa5qc2y/79XXeKNkgWgmnafHoUw== X-OriginatorOrg: ddn.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2024 10:31:06.8276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2c9a0a2-414a-4e11-77a9-08dd138598b6 X-MS-Exchange-CrossTenant-Id: 753b6e26-6fd3-43e6-8248-3f1735d59bb4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=753b6e26-6fd3-43e6-8248-3f1735d59bb4;Ip=[50.222.100.11];Helo=[uww-mrp-01.datadirectnet.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000A345.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR19MB5402 X-BESS-ID: 1733221870-111173-13374-2072-1 X-BESS-VER: 2019.1_20241126.2220 X-BESS-Apparent-Source-IP: 104.47.59.176 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkYWJiZAVgZQ0MAyySDV1CzVIC XN3MzYMM0iMc3S2NwsMSUpycLcyDhJqTYWAKvmSClBAAAA X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260854 [from cloudscan19-146.us-east-2b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS124931 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Change the type of the res2 parameter in io_uring_cmd_done from ssize_t to u64. This aligns the parameter type with io_req_set_cqe32_extra, which expects u64 arguments. The change eliminates potential issues on 32-bit architectures where ssize_t might be 32-bit. Only user of passing res2 is drivers/nvme/host/ioctl.c and it actually passes u64. Fixes: ee692a21e9bf ("fs,io_uring: add infrastructure for uring-cmd") Cc: stable@vger.kernel.org Reviewed-by: Kanchan Joshi Tested-by: Li Zetao Reviewed-by: Li Zetao Signed-off-by: Bernd Schubert --- Changes in v2: - As suggested by Li Zetao, also update the type with CONFIG_IO_URING=n - Link to v1: https://lore.kernel.org/r/20241202-io_uring_cmd_done-res2-as-u64-v1-1-74f33388c3d8@ddn.com --- include/linux/io_uring/cmd.h | 4 ++-- io_uring/uring_cmd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- base-commit: 7af08b57bcb9ebf78675c50069c54125c0a8b795 change-id: 20241202-io_uring_cmd_done-res2-as-u64-217a4e47b93f Best regards, diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h index 578a3fdf5c719cf45fd4b6f9c894204d6b4f946c..0d5448c0b86cdde2e9764842adebafa1f8f49e61 100644 --- a/include/linux/io_uring/cmd.h +++ b/include/linux/io_uring/cmd.h @@ -43,7 +43,7 @@ int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, * Note: the caller should never hard code @issue_flags and is only allowed * to pass the mask provided by the core io_uring code. */ -void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, ssize_t res2, +void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, u64 res2, unsigned issue_flags); void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd, @@ -67,7 +67,7 @@ static inline int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, return -EOPNOTSUPP; } static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, - ssize_t ret2, unsigned issue_flags) + u64 ret2, unsigned issue_flags) { } static inline void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd, diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index d9fb2143f56ff5d13483687fa949c293f9b8dbef..af842e9b4eb975ba56aaeaaa0c2e207a7732beba 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -151,7 +151,7 @@ static inline void io_req_set_cqe32_extra(struct io_kiocb *req, * Called by consumers of io_uring_cmd, if they originally returned * -EIOCBQUEUED upon receiving the command. */ -void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, ssize_t res2, +void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, u64 res2, unsigned issue_flags) { struct io_kiocb *req = cmd_to_io_kiocb(ioucmd);