From patchwork Mon Dec 2 14:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 13890771 Received: from outbound-ip191b.ess.barracuda.com (outbound-ip191b.ess.barracuda.com [209.222.82.124]) (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 E79041FECB5; Mon, 2 Dec 2024 14:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=209.222.82.124 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733149357; cv=fail; b=Z0XF3rqP52SSECmviO5rJQ9o2F51mVtGKhw4XccVpS5HqCw1Ay4kA07LPSgvZ4Ql/rTTgsmTvWKioja5Ihquj2TzHIVwrcZBPYRYCadpJHSPHEN2h3QWMbjVPwVDEcbBQs3apIfC1KHgx698obNLdO/i8FJwJ6OtZctGjmuFDoU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733149357; c=relaxed/simple; bh=b/kQPnww33L7qzXKzq4LlnNBYkpstgz6XZGTA26G3/4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=P/NDn8R8noYjlyqpx4XhLyZ2ba3wvryYuYAUVo8BLUtCG7aAQzUL6uNep7c3hlS8yGwyi9utDpCyqL+OAERoQFRl3GyCFE8DcicSprkXNb8B8leSoGzyr+Qa4fkLf8tNYH0OoZAUHD0xXJFx9BI7CH1KGlGY+l41ocAzUIXmx/I= 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=cPdoI6Z6; arc=fail smtp.client-ip=209.222.82.124 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="cPdoI6Z6" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2048.outbound.protection.outlook.com [104.47.70.48]) by mx-outbound43-151.us-east-2c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 02 Dec 2024 14:22:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Sb6xpKxnMegiSZIgLHfJg6Ph/Ih0d6LctwkIrZXXQPQ/SgZuirKwWQO6vwLeBPhUrmoLjhAOTkXjku9Fj3PqciZNCs8OuGZGIEF1Mnk0tn0alHT1XWY8yVpWHNBOU8Kj2yiXEmOB43jDr1VWYQ4Ap7lwdGCHgkYtgg7VQA02KlhYS8kZ9/h8N4n6fS97aAi+JdQ0pRLIOU8ufBCXZl6u+MkUqsYJVpmQ0wJRZy+5ClRGhjeWmKL5pEdZZolEAMVoZJ3IlHp9l+DuyBR2yBqTUdAKk+9EaR7k+SSOZv7rBCG/PCVc4o1i25dSOi0oLoNS3ky2hP6sBASmn4ZuRdrKVg== 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=uN1U/7zX65BvMK+7aSiOnFT1NOkoitMIZEj2vKGjTMA=; b=I6ODQuipZA4p62vNnepqjyIEsoz0AASUTpGiExdiiDl/JStEtYyaYUu/foTASvyDWSasccJ56HIYb1BXhA3SCphCKn2yyI6hkg/AS/5TYf5VPYaYK5E7CFQjGvwlndhdIeFJAGZ8GyPxE6wKuZRjHXat+rUCKmPWifOioeqpmRIWCjcEM0dAxUivSWR/EDBx7pL9KvuQmwnH5qf5vVk6fy2KkC0HthdaEoiO2XFyWOzEahsoH+JQOw+k9d8Gp5M0xXqbSZXZx5/ZioTbwIz/GyQwHDO7V+FWpF/LcgGmO5HvLWKqo9QIt3wrWTGO0UshRMcawyurAYgx/8swaXPwWw== 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=uN1U/7zX65BvMK+7aSiOnFT1NOkoitMIZEj2vKGjTMA=; b=cPdoI6Z6Fk2g+x0jBDJ9HHBb2qyp9k12WKohnGgeYvZiGDCqydiY7KL90hGsqgepjSzFfPLF57Z1bNsEx3qEte4soB8zfrD6qD6zLk8pWs+8uIvyCd44LzjEXW13qHzkDdxXVwfTX6rHS+69Zkf9DC3yqqa1iUoMaTpAqb0e8I0= Received: from MW4PR04CA0062.namprd04.prod.outlook.com (2603:10b6:303:6b::7) by CO6PR19MB4739.namprd19.prod.outlook.com (2603:10b6:5:347::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Mon, 2 Dec 2024 14:22:19 +0000 Received: from CO1PEPF000042A7.namprd03.prod.outlook.com (2603:10b6:303:6b:cafe::65) by MW4PR04CA0062.outlook.office365.com (2603:10b6:303:6b::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.17 via Frontend Transport; Mon, 2 Dec 2024 14:22:19 +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 CO1PEPF000042A7.mail.protection.outlook.com (10.167.243.36) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Mon, 2 Dec 2024 14:22:19 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 049802D; Mon, 2 Dec 2024 14:22:17 +0000 (UTC) From: Bernd Schubert Date: Mon, 02 Dec 2024 15:22:17 +0100 Subject: [PATCH] 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: <20241202-io_uring_cmd_done-res2-as-u64-v1-1-74f33388c3d8@ddn.com> X-B4-Tracking: v=1; b=H4sIAJjCTWcC/x3MQQqDMBBA0avIrDtg0qDoVaSENJnoLExkBktBv HtDNx/e5l+gJEwKc3eB0IeVa2kwjw7iFspKyKkZbG+daUGu/hQuq4978qkWQiG1GBTPwaE1Y3D kxvf0zNAeh1Dm7/+/vO77Byb5O4VvAAAA 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, Bernd Schubert , stable@vger.kernel.org X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733149337; l=2205; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=b/kQPnww33L7qzXKzq4LlnNBYkpstgz6XZGTA26G3/4=; b=AUCj83OcKHDaCLTNeZvob1Bd4Mdh9Df6f02Mf9QSB8ecMzLvKyUNAgRrN79+LNxhAj/Zq5uIN kifUlPW3MvPBiBEsWF7yaYY67hHuyeRci4BTCxiKzyIxS9c2znW47/T X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A7:EE_|CO6PR19MB4739:EE_ X-MS-Office365-Filtering-Correlation-Id: 11896859-35f7-460a-5698-08dd12dcbad8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?VOBPmVKGQPMfSRl1Dq2/aNwIh21RiEs?= =?utf-8?q?wFB1iaQommYOxvC8KIdcpXp6u2AXUQE7A9SabeuiAfrJF8gt2bAcRLO4+YYr1nEy4?= =?utf-8?q?9FUl4wWSiNDxQ9mIUKI9R2hHy8N3IGrK41Y1LOgnMl6TCeBhgFyKZyUlUCVRa4MKO?= =?utf-8?q?YnYQWWXUb47f/4NNZl3gW2IycS7nWRnF8AzPi9oPERyu1aMJVZqbPeQ2/+fPUYggo?= =?utf-8?q?FDBi4p9ttjLuoTyKRhdQOU0PE/Y5/9IpIIK6ZjQwRRHLSDarYoqc0NGWvxfzDsyG2?= =?utf-8?q?7L/EA2uhtd+EpgxtQn1G0Ns5qZHW+1rsfheQ3OtYfE7e4FWxssGL0KSkyLjsSraW3?= =?utf-8?q?iEvLjDqGdl5bKLN0fxu8eDZUy6l1T7WnjlpfkN57QjXkUUWf558/EtjaqUOnnQt9G?= =?utf-8?q?nzoSbB18q7g7rObF0Y9JVqFGSZ1XB6E+B6WRFPvI+NXE0I1LR+gZ3iw4SzIStwKAX?= =?utf-8?q?VSy1rNszPZQEztTSEuBjCrVmEM8pB5qiCuI7s+xdwFSdZ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9OZ/f9a+hma9ATZeh+EpGo4ZL66ZBF?= =?utf-8?q?YEkYbzN5yND?= 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)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: MWpBF1iO07KmjiQaSvbjfMP977bwrI3ARCklK8DPwRfo5hupMSxbp6+RiYDpQzw0nptVZFslLeyo4DGQMLo/jZ/8ygx/pMbV8pbwPCHjNCGuSJG0wA3F731QxjGMDV8lgGux3fWdxSyUIyejMRX4gTtIw7Usc1BWxo/ElSFfEUdaBO3LLbVd2nBx7JWcZM4NJTF9sw3psylR57op79MeVd1D15c4vJeDBqGI3DN0COIq9JYlZoyPw/xhbY5H1x8DGGMCuEJy8tqGHZA6BPFwnJyeC+9D7IciDKHq7LIpH88K0uMx6x2um19M7cZaYB99QlPKfS4J886QtkIn9jSVll4fBsi1naA8r4RQVcuTL50/WqaLE/D1Zddf+gVnvWI9s3hSMXIAbjIvxTwYH2wktB694jd+93JfPEu3d0mimuT3jtnXd7kp8a2nlH5KIbAYXMXXP7ZFJEgxQkpVtpdmjiycj02LtDwWYzi7zMOP/9p+lMcoyXRSBtrGsJuuIRomcV2dsLVXNKmsXFtZdT9sZKYsiOHiIqTpvnQ/0wqkefe7n5GQxrKHiLCxukYq9Jyqi0SpR+n6xgwwgorkAT6PpT31Da5U44PkbqRw72DDNDjm51ox1pgYXyAItMx0M6c2/Fr9cyUTqqgua6gqyrSQ7Q== X-OriginatorOrg: ddn.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2024 14:22:19.2386 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11896859-35f7-460a-5698-08dd12dcbad8 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: CO1PEPF000042A7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR19MB4739 X-BESS-ID: 1733149342-111159-13540-4031-1 X-BESS-VER: 2019.1_20241126.2220 X-BESS-Apparent-Source-IP: 104.47.70.48 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkaGpqZAVgZQMDXJ0MTAPNXEyN I40cLC2NIwOTHJ0NzE3CAlMdEkzdhQqTYWAFRqH35BAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260838 [from cloudscan17-245.us-east-2b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS124931 scores of KILL_LEVEL=7.0 tests=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") Signed-off-by: Bernd Schubert Cc: stable@vger.kernel.org Reviewed-by: Kanchan Joshi Tested-by: Li Zetao Reviewed-by: Li Zetao --- include/linux/io_uring/cmd.h | 2 +- io_uring/uring_cmd.c | 2 +- 2 files changed, 2 insertions(+), 2 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..75691ca2043acdf687709bb2f27829a1bc7a1103 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, 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);