From patchwork Sun Sep 1 13:37:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 13786513 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 C91793CF7E for ; Sun, 1 Sep 2024 15:09:13 +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=1725203355; cv=fail; b=G9vC37Moe5/8puHra/8k+p5NSXS6m2AkWgd+jp10kYxCVYqX8UjjHUlg1av5VaHCA1ywhzH4ClGd8ToAoVwhCdhtthxHOFxdpGz4OHxBuScoZ4pvNpjDjTN627Tzc4krZGYXIkNjtdrWlYCOyUBkpienU3N/0PRASFwVt8kXeL8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725203355; c=relaxed/simple; bh=8dhkqhFwHO1uc2gQUMpZEDKo8OQGVPegTAACyzpk3Xc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eIr5gkxF1pvT87WLyBcCWATJTF81lSajCIzlGQh3HFDsSCC22m4hYzB7rAiVH5zpqRqV1IhFMqX6jLHm3m4xID40DPToCOuxFweETp68PHUhLsvTWevLU3Y7yILrFccMdXoufvvZbWxLQRnIFXYh4c7iR4XygnRFmE7Te8uiKdk= 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=kTzLJIMX; 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="kTzLJIMX" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2045.outbound.protection.outlook.com [104.47.55.45]) by mx-outbound46-229.us-east-2c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 01 Sep 2024 15:09:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ef7oE2nGH4RBI1GtaRyKm+1FXEiW6xBt70BkkCqRK4XQpBnHEQ9YYX0maH7tEVQr4CALgztmHbwly03fH+lqWMt0d+kGObaN6GaWNZAImNcDb3h1cMa89IgYcHyrOdAXwEFr8N6202ryAWHmLw+0R+Gk1PP59Ntra2jrqnfpk75t/4IqhYSjN94FqD4r4xOaGYjyhLTca2gqyFdM6MgoU5vIptDfkhYxn3/FDVJ6KKc8yeWIo3FFXChZrxFcuJyIMgSQ6LVTmTBFZcJLPcgN09N21MAsWCvIGTDQ2oy5HXnsdzRxHJ6Ym7OlGWwMh/+qUT2z3FmpUW71wzssfeaZuA== 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=pgMtCDsoXOyo/QPcdUDSpQJhzlP9ifRQC1shbPtI6Bo=; b=J9N33ICax4UZ7MEG7UZK5Qz1P28/fUeZT7waDv4mbON1p67qzgeqjIKiG2p54YKRVyRnrhdDFHTv59TNSPCpkk1Cxjk8sm6tS/PUuff+QGCf66JYccMXJokMROkTPQi+ShH/nvxduRu0oYXvfa8+BxIbQJDguYYJ/hcjjbEm+EaQamAMRIr+cZJIpntjULlDqr798qra6MHJdeGpcWQGe61ReHfl8iLV+tTR9hWfNTH8yfpibtU2uqyasmwlKg0iThXx6s73+nQOkVqu5I5XwFAS9sbMT9LhvH+QSIL4MJYCSNaivKu9aaYJRWw3IofBw7Yq/4GpK+ZRsFxk7RJtfQ== 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=pgMtCDsoXOyo/QPcdUDSpQJhzlP9ifRQC1shbPtI6Bo=; b=kTzLJIMXC2rUOq7z5gV9BecSC7g2iI64/yBWn0z7hCfsJ9iZDe7Zy6Cd5PKnH6RG5mXYCDmm9BdwPy/4WHqfaVrzqrsSCbs+Z1PNCZF34PRsmFccj7em6Hw1aMpU2fmejUcFydFWsm9xy0KpMpaV2xjXjyBG8KZosgkw+42nEA8= Received: from BN8PR15CA0043.namprd15.prod.outlook.com (2603:10b6:408:80::20) by BLAPR19MB4244.namprd19.prod.outlook.com (2603:10b6:208:276::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Sun, 1 Sep 2024 13:37:14 +0000 Received: from MN1PEPF0000F0E2.namprd04.prod.outlook.com (2603:10b6:408:80:cafe::63) by BN8PR15CA0043.outlook.office365.com (2603:10b6:408:80::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.23 via Frontend Transport; Sun, 1 Sep 2024 13:37:14 +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 MN1PEPF0000F0E2.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Sun, 1 Sep 2024 13:37:14 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 34174D0; Sun, 1 Sep 2024 13:37:13 +0000 (UTC) From: Bernd Schubert Date: Sun, 01 Sep 2024 15:37:10 +0200 Subject: [PATCH RFC v3 16/17] fuse: {uring} Handle IO_URING_F_TASK_DEAD Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240901-b4-fuse-uring-rfcv3-without-mmap-v3-16-9207f7391444@ddn.com> References: <20240901-b4-fuse-uring-rfcv3-without-mmap-v3-0-9207f7391444@ddn.com> In-Reply-To: <20240901-b4-fuse-uring-rfcv3-without-mmap-v3-0-9207f7391444@ddn.com> To: Miklos Szeredi , Jens Axboe , Pavel Begunkov , bernd@fastmail.fm Cc: linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Joanne Koong , Josef Bacik , Amir Goldstein , Bernd Schubert X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725197817; l=1048; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=8dhkqhFwHO1uc2gQUMpZEDKo8OQGVPegTAACyzpk3Xc=; b=eyrkXfca8xjIyuTMNoR2ImJakYrTiEZVmR0snVkBZJcHwDUfU1JDpD2sC4dEjPAEgSZ/5S0Pb iDnX/5kB43NByHkzoRjZ6kLrYvMtLCQwKg3/0KJcddn7FU24ID0uw8m X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E2:EE_|BLAPR19MB4244:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d8d3189-d8ef-49ab-b5e9-08dcca8b3086 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Kh3gcvIcIw2vQ2umbuzbCq8VCmAyDVd?= =?utf-8?q?KTL7It6kIOR+N5XeSeFN1VWulgWNfZOmVAXb1JFfvydR/fd7+akTg8zkhF+pQwdmD?= =?utf-8?q?wkQ5lQ4HfwqfFAnZ2ZLGPM6NEkjoAZfmN3VKkVQ15PN16AcljMRYAEyStTS/WWsZv?= =?utf-8?q?kByRL/g0eEjMD9OGNPvhGPk0IJT+Fhc8dgKgPnBDOGLEIFPOrYFPmaz2hBlRpXBKy?= =?utf-8?q?NuaQy10m1DMrkHHmhEGQe8gybwQPBaB9kphssI3KmJbA9L5Ax6AF6G+pymbeWVk/b?= =?utf-8?q?phl95HnYci/m3vfLJl6ynltbljb9motnGgKLpnQjghV5S+YLYHytVFyqu5Rq5U/8c?= =?utf-8?q?eXlmR5PnAOB6bfZi4yyTxAyG4jgVVnF87TY7kdQLvslq+bRB0IBc7/gw8nG3bIEzU?= =?utf-8?q?wPaNSp2O5lhST48A49/9am48c/AR55uQyf15Wl8OsLPRxh/nBv/QelGspgYBxFRh0?= =?utf-8?q?cyEisGIgVOhiNkWrSGiCcvUq3D2z6BPIxf0ctmM8QIIIDN8mGo18KSI/XvD/ARtK4?= =?utf-8?q?nCP865Ga/mku8tPh9Y2bLGQiY3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-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)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: kcYNadwZd6OcT7bg24HnbP2JQK/SXrf51IW34HuOZGwn4IBeoUgrLj5O5CQSiLfzV48JrsjgwKxJ4vsLPcIyh9i50w1hkaQJ+17JpnFBXpI5OVsD14pwFksnYtDXOqjfU2e8QqUjngmXF5XViFovWqlEO1xRM5T6MFCKzwaWZTDOPydP9HlOp37SFoY0xSoAwCLIyWsu4YOBAtvu8qyMCk7H5GLmPHjnlp3wRQKYlRjlkLyJzIJkdjK/2obOdqhMkUeMoQzkzQBlzGce7YjY9/5icbzSVG6iYp8lTtdt3/U5WnVgkSussznC5jW8i4CDF88V4JKk8Uel7W8RtIobyUulnmKYPmuY692VyVAzQG3fJYvzHSofSjojGgrV9/pzrHgbc3FTfM7Kw5s2UTfXxuS5uv0dxJKUy+1XpAf2JsM1kxSb+JVCUx/Muo08t2c6Qzf9Y3MR4dUJmi8Khaaj81dDCARhqSC5fMsm2H3h2IDy4cd1DPqJRtrylNwwKyZJyP95yW0WbH9/NGnJrn8BqB+zEGS1tjnNuE0AE98PQMlBq2mNJohCNwvdvevZ211gS7Rnbvrxg2Eoa3lRAZJggxB59GNq+BuLFKVeBlpHPoZ9O0Qxd2XLCG7RZKF+g2AhPsLUFWGw6xcD0Opb8nBF+g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2024 13:37:14.1761 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d8d3189-d8ef-49ab-b5e9-08dcca8b3086 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: MN1PEPF0000F0E2.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR19MB4244 X-OriginatorOrg: ddn.com X-BESS-ID: 1725203351-112005-12689-916-1 X-BESS-VER: 2019.1_20240829.0001 X-BESS-Apparent-Source-IP: 104.47.55.45 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYGhsZAVgZQMC3RMNHYyDwp1d gyydjYNNUkLdE41dIs2SjJ0jTFyMRMqTYWABcshV9BAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.258745 [from cloudscan12-95.us-east-2a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_SC0_MISMATCH_TO META: Envelope rcpt doesn't match header 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_SC0_MISMATCH_TO, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 The ring task is terminating, it not safe to still access its resources. Also no need for further actions. Signed-off-by: Bernd Schubert --- fs/fuse/dev_uring.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 43e7486d9f93..a65c5d08fce1 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -993,6 +993,9 @@ fuse_uring_send_req_in_task(struct io_uring_cmd *cmd, BUILD_BUG_ON(sizeof(pdu) > sizeof(cmd->pdu)); + if (unlikely(issue_flags & IO_URING_F_TASK_DEAD)) + goto terminating; + err = fuse_uring_prepare_send(ring_ent); if (err) goto err; @@ -1007,6 +1010,10 @@ fuse_uring_send_req_in_task(struct io_uring_cmd *cmd, return; err: fuse_uring_next_fuse_req(ring_ent, queue); + +terminating: + /* Avoid all actions as the task that issues the ring is terminating */ + io_uring_cmd_done(cmd, -ECANCELED, 0, issue_flags); } /* queue a fuse request and send it if a ring entry is available */