From patchwork Fri Feb 28 03:30:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13995529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59BE6C19F32 for ; Fri, 28 Feb 2025 03:31:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C48686B008C; Thu, 27 Feb 2025 22:31:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BAAB06B0092; Thu, 27 Feb 2025 22:31:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FC116B0093; Thu, 27 Feb 2025 22:31:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7A4FE6B008C for ; Thu, 27 Feb 2025 22:31:33 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0A343B3FE8 for ; Fri, 28 Feb 2025 03:31:33 +0000 (UTC) X-FDA: 83167928466.07.590B84C Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062.outbound.protection.outlook.com [40.107.92.62]) by imf08.hostedemail.com (Postfix) with ESMTP id 3EC1C160006 for ; Fri, 28 Feb 2025 03:31:30 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=EfZ0OHr2; spf=pass (imf08.hostedemail.com: domain of apopple@nvidia.com designates 40.107.92.62 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740713490; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7fpOKX5mt97+LmuzK0U3LyecTQPT8dlAshklE5pRhO4=; b=8bw+KJkxT8/8+uO7cgEar8WhccDeBkf7EnDWq4WB5zRO/gtoXQdn34ZfzUN97gOl3S6Jv6 Z5QD1PSJjkft/rPgkB/AAe0S+yQwC3C/L15qMMngPF/r7/N9wyefG1vI977CIMw93yzOUP uOsXBUaPCEoAbTljjgu/eGEjS7DSoMo= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=EfZ0OHr2; spf=pass (imf08.hostedemail.com: domain of apopple@nvidia.com designates 40.107.92.62 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1740713490; a=rsa-sha256; cv=pass; b=clbsOQICOL01okoyEb2G5M8fXc/cVTO3ElyQNKtS40fb7kp+kZlxhwcf1Q5HBAvwCoridL DPh2U9fHiLsg4E7XJLRqa1qeIONMJ8DTRDAweb4f0w/3fppx71PT9hPL9YPKXooTXwwgqB 5Wgw1JbYDZWMmCVWpSnMrVLZC9WLHRs= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=axZRmNhuh0GMFUL2TdBtHhgGOXIc3fy0GjhtemjNp76fi43CvqjRrkWUnK4ih+GTrcYFdqP2xyEi8/5N1njyhJdT3v0oMwjKKfzoOJpuGAclCVTvN4gjaDqpGvU3KkfaJeTFtYPHJc3F1AiMGW7C+YNU2NYD29LJibFbAdbSOyDo0/wx4c6bDlLBiJcCyxtf4BCz/Y+15yPXVg0LflLERVhM9Xdjof7VKI3dTCN+efRsBGClXOGq8IswLe+L6nXTy7DpFf4FYt+hbnAoyGgACxY/+GOGweRzDNMQpegqSkpB9xTf4Kl1MWgLA88ffI9a+RRcf1hJ3sqnTK41uZaiuw== 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=7fpOKX5mt97+LmuzK0U3LyecTQPT8dlAshklE5pRhO4=; b=A0Mo+qyFZR5m04ZRiPvVy1C0ASZReL2BsWTkW1/sWn0zyFAIvfjPaaDwMqaZSJjTffsnE5woj6JdpNld4I5nw4ObW+Rjgdqs3dYP5wUrETVWnEN0Cj2KoTIs+O1Uw6gzHx6s7lLRJtns6adTEXFXrAQcxwkWVlGAky7k95eqHYBAaMs4+SQLrFFPADiC8B6H8rMlVOt9pnE8k+qpbVx6I/Mxrc2+Fuxpz2k65aXtqCMGghR0OP8/XSp1NrH6Q2EdKhwk33NW7w8lscHzSlY8a1vjgI7+esQqzBBoyIFywL823xqw781106decJzI4oeTVRSBOgkiuau7rmj281aULQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7fpOKX5mt97+LmuzK0U3LyecTQPT8dlAshklE5pRhO4=; b=EfZ0OHr2XvQ3rSDEGxlkwv93I/lEFrqYSSGLCkEBYi9U8UUvhdnXYNphUqsxSofh0mM1dQSkrn69WpLnT2WZje+7xH6Je2g6k7+1RE8WfEivZF7VJY0X8AQ9utlWZmdHYkZZAe2AZ/z9O25h8IeaLallqgm/UpT6HEcocfXfmmM9xyTqIkpeVLQNIqCEYnzs8DjsNLZkT2GONSS2wXIYiwzmBJ0fTn7VPbfqP2tE/oD4kTdPzaD87f7HzkmyYpByFs+Lj24fJWclQNy0d0RoR+gNaMBLzRZvxauLnw2pHEVI/QsPsT+cS2tl9SRh7ESqX0dkxS2Eu6O+0ToOrZrZeQ== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by SJ2PR12MB7991.namprd12.prod.outlook.com (2603:10b6:a03:4d1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8489.22; Fri, 28 Feb 2025 03:31:27 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%7]) with mapi id 15.20.8489.018; Fri, 28 Feb 2025 03:31:27 +0000 From: Alistair Popple To: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org Cc: Alistair Popple , Alison Schofield , lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com, chenhuacai@kernel.org, kernel@xen0n.name, loongarch@lists.linux.dev, Balbir Singh , Vivek Goyal Subject: [PATCH v9 01/20] fuse: Fix dax truncate/punch_hole fault path Date: Fri, 28 Feb 2025 14:30:56 +1100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: X-ClientProxiedBy: SYBPR01CA0050.ausprd01.prod.outlook.com (2603:10c6:10:2::14) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|SJ2PR12MB7991:EE_ X-MS-Office365-Filtering-Correlation-Id: 462f3f6b-e815-423d-893c-08dd57a86241 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: uaxkybciKBx9pL+Z7k2S3EyQ+dnds/q1XVVjKieTZfXEG1w9p5XjxDCSbunZZx8q+MdHfVeNzMQoPafrTtf3wm/31FLEAkz1oNhfcR84BUF79nSNOXQ+CE41dhl2RKiGSF58YdKdwUj9vOH9FUUXkCjPOjh/98uW8RMY/j3MH/GxFGnizl+e82+q3vAxVuGNf8u/ItsS7cjwxQudPXR36ATHf58z+ym0tQ2ZgWtbXKgYuil7oV2svjStx4RVa58+jb2Zinl62nKpjI75tb76afgUQ7AFGcTB0EpIvJW7DO59NW5gVkaVQHM2YKHKFCLelOcNfiZq8bSoGIRHW4rKyI54fLqLSrD5kWyjfWGESI+Zd5ODINQ4Z5OG2/UuF3tci6jxLrJo9rj6ALftU5JZ6HeGFmtI6/8/TX28VMyBQs9Bzh7coh0aVBKptye1fhng33Wvs58mj92omFdxMCiqlX3GMof4hIyKZ9ze4ZL0vvcnQrWsUUemHQ9e7zI1qQGoG89fpEmbHAoRBVcnQCZcprKvDHtIES3HN9/lhgmRZbpAxViHA5jTjbA/8vKneukJG5pHlnWI2YdaAZpnmaxEs7sl43cqUREHgdEYHFq7BcFh2YS6Uu7OBhM3+kxD2oqFwCFTVxgf2x7cPKPzsiYZofOgjFyRpWIV0CKQwzhxhfrmiDLMq0goj/5Z79HZetujtA+LV539JNJLGnOHcyPLldilXsA7T6lGod1MWyD70HOr86at1PihiV+e/GDkKyMgEJY34mnfud8J3GIKfHAvLMm792N9IP81a8AelPrn31/AlPpjqFPXfiD6aF5Nb5uALL71ncwOJtXmkTx/k19XC14VEORqfFo2rVGuLRvmLPw+imYfyBV0EL31l9AOlkW632HQ8boXWXGLSL7REdxmQShY48EgwRMXC3AE9VaqoBQTo6gFIQiIQBkpbPHo/b+GBIJV64p8cW/RtMRJBSNxdR4JLPALnXwPXnW1Glp8yLHqtzAovHVJguk9pC8D+/jLMgLRRvsYdl8OTpGg+4Qbf1vsIcctERmOjUzeryWOVuL9uSj+dqqzWomd8kOrZoEUUZ0Q90JbhUUoF9Yy5W1ps2/5SB2BOpm8Wa03VZY3aZBBroQaBavz4ognVfJRMBrdkm59TrxlZwFjgEtvjfK+tgtwqYTCgcT6y4I9CLxLlcTHB0SIEi8wYt9z39DgHL1ru4sLqxk4+d67zDh/AtIryAXkTBJ2sIX+c9hQmf3UXK+PrEPXPwklE3FnbCt6jKxgvgUYwOLcrOv35WsxGEPCO/zja18hLHmCiWpHUafUNgjKzhqDhCGWaCJDnZ9tDH4kLKXFUjPi+L9ulbRMWcmkoZ1IVSS1j+qNkOumXa9DOq3QpXfjH4UrFr9r2kbJaStR X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sHwKyQwvSsAQpRA1U/ghpgjiny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HafiyCQTPLj4QvM0K91kIjpQabmddp3qAiDorlQYj2lc1uZrGrnmlgV9cXN3nTXumfykv75ICG1XvYeshR5BcPNB95ec9P4yW1EPXCLIjKBexOAoMIpEwhHXqIrvRUy4yEZoi/d5xg1o9jTQ+7ZrxlFUEhNQ4ppbg3XUslAaGvaYzgFhYvcIzTE9mIhTjZLE9vt5jncONXa/N2kOJ+QsiQH2YFsqPH2Lk0ebmotu9sRQ3A6hqxjtjC7kiZfcgq4HIqhIYWkk7B4gjU5N3S4BfuILFtxZMMkqiPzZHAPGkbBazMHkKcVgL4hQAqF9V2rIjyeBL5jplh+lccM5QfCBqeEur24dvXg3YJ8IyRoOBN65u+PwtnauA+nbXeL/PmauTskri4yN0/NMQ4PEoZ8siKKAQrPGI8tiyxupIhbsaBVbhOy4O5h9nDlROcJ0rI2r8IzyKdX7eFEeqStA5BOV5otZg7G90z5V45 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 462f3f6b-e815-423d-893c-08dd57a86241 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2025 03:31:27.4940 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +C+gNYtBEVdIk6n1GGM15g9rWRqwqEeQQuuXT6mE8gWGUIyluFJnY1nbdM84n6pTfhs3M7ToGHjIJhhZsAaj0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7991 X-Stat-Signature: nqiouxox57tiepzpp1ggom7a3qzhd89c X-Rspamd-Queue-Id: 3EC1C160006 X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1740713490-151978 X-HE-Meta: U2F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PJnLt8zogJrPLJ4178Dq6Ge3O85hvGzBz4N9iz7VUhRbqChc2DmSXpHbzowS/Zt26ZDyo3lZEt9CF1b5RmJGcPuldapLzLv906HQBF0crTYg9RqaSBfaeVWZViswkUhWbzBM5eUVZfv2ZBiNQ3ozHajqM59mLGahhD+Jlm/pngsPWcIh1iUGlOQlCPjmRNnSOLT1kOzSRiCDPNIBw9j9nXetbzE7fkMKzBESuDEtLgbca0gLbtTjtGWRrHitMDmou9/vupzb3oZCgcoc2wR102Ciyd5jWWD8tHJBRkF+IDSHy6ie8r22yNul2rU6yuPjk0qFh5ixjrhE9zpYeHppDlK8mHEdfBO/dFLZyJFEErnZOPM6VRwq1k8B++34J/1yvVVJixafa9wM27lK0hvIvS X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: FS DAX requires file systems to call into the DAX layout prior to unlinking inodes to ensure there is no ongoing DMA or other remote access to the direct mapped page. The fuse file system implements fuse_dax_break_layouts() to do this which includes a comment indicating that passing dmap_end == 0 leads to unmapping of the whole file. However this is not true - passing dmap_end == 0 will not unmap anything before dmap_start, and further more dax_layout_busy_page_range() will not scan any of the range to see if there maybe ongoing DMA access to the range. Fix this by passing -1 for dmap_end to fuse_dax_break_layouts() which will invalidate the entire file range to dax_layout_busy_page_range(). Signed-off-by: Alistair Popple Co-developed-by: Dan Williams Signed-off-by: Dan Williams Reviewed-by: Balbir Singh Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax fault path") Cc: Vivek Goyal --- Changes for v6: - Original patch had a misplaced hunk due to a bad rebase. - Reworked fix based on Dan's comments. --- fs/fuse/dax.c | 1 - fs/fuse/dir.c | 2 +- fs/fuse/file.c | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index 0b6ee6d..b7f805d 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -682,7 +682,6 @@ static int __fuse_dax_break_layouts(struct inode *inode, bool *retry, 0, 0, fuse_wait_dax_page(inode)); } -/* dmap_end == 0 leads to unmapping of whole file */ int fuse_dax_break_layouts(struct inode *inode, u64 dmap_start, u64 dmap_end) { diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 198862b..6c5d441 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1940,7 +1940,7 @@ int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry, if (FUSE_IS_DAX(inode) && is_truncate) { filemap_invalidate_lock(mapping); fault_blocked = true; - err = fuse_dax_break_layouts(inode, 0, 0); + err = fuse_dax_break_layouts(inode, 0, -1); if (err) { filemap_invalidate_unlock(mapping); return err; diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 7d92a54..dc90613 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -253,7 +253,7 @@ static int fuse_open(struct inode *inode, struct file *file) if (dax_truncate) { filemap_invalidate_lock(inode->i_mapping); - err = fuse_dax_break_layouts(inode, 0, 0); + err = fuse_dax_break_layouts(inode, 0, -1); if (err) goto out_inode_unlock; } @@ -3196,7 +3196,7 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, inode_lock(inode); if (block_faults) { filemap_invalidate_lock(inode->i_mapping); - err = fuse_dax_break_layouts(inode, 0, 0); + err = fuse_dax_break_layouts(inode, 0, -1); if (err) goto out; }