Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1510305pxf; Fri, 2 Apr 2021 12:35:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIa78sI0CsURutJIGNBdxRn7qQhMToZzg6lek/G7GlFnlQIPpNwgssdzNgQX8kgwfZAf7M X-Received: by 2002:aa7:d1d0:: with SMTP id g16mr17136398edp.358.1617392144419; Fri, 02 Apr 2021 12:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617392144; cv=none; d=google.com; s=arc-20160816; b=MtT3sO8gyEOXsmkFt27ouhNJMRGzQApsp/OBTwQiSaEbfBdctXR4BkAdXz/vEjq6sS qKFlk7EMY5q31YWn88N7UzILJCYkcXVFGE1NnvE4315V9qd7KqvHh/fmyv/wP+pImf2I khRz0HPOTb3DTiKYBAxOmgLeFKZ2sP/aW6svtI1Tu+0dYQ2sT0VipzDmIAlihXcNAMZg Dh/fl/YCnCABfz4Lsri2LgBrbIUw3O9n8VOSG1lsQcYiBBI7gnKjFZ9v9mafF7fNF6PQ Whhba2kmSs85LZgcpW7nOVIidxGPazegB3Wr8TnLosXzNBxcU2ygQN8rYxcLubiIfgxR pFBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HNPu5aKbWQwNjzWI5ProcGvxoIxHDC5blNfz3t3eKtc=; b=kvk68+AXNvOg9rPThCRPlxlraQh6cph5qoGxiS9vAFfF1fNZ0JZ9OnplTbSXLwpQuM QyNJfmBf5Bdep72DPgdLld8/adPREzKs6+b1yIDqUBIM6sBDlLrk/2n3KCNymPfXinsb tDH/QlxiUA9ZcESODAVt3SD5wyTko2LNsLWgaw9wdgVIkzTEorOAXn/Rg2kxqYG0/vUQ rhsyJ3VPPPX0OGewwxvGyRT+pV9xc913PoOWcAjNR1+vtEfC68ctwAIGAUJJCV447cID w9rHxgYymR1RZluTuhqMPPkkMhsidMApuutYJSBQ2+Sa9ZE1S/Il2aBYtQ1KuSqEckVs jRJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si6847816edw.62.2021.04.02.12.35.11; Fri, 02 Apr 2021 12:35:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236539AbhDBTei (ORCPT + 99 others); Fri, 2 Apr 2021 15:34:38 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:49126 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236560AbhDBTeh (ORCPT ); Fri, 2 Apr 2021 15:34:37 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 132JYEa0017030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Apr 2021 15:34:14 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 0628E15C3ACE; Fri, 2 Apr 2021 15:34:14 -0400 (EDT) Date: Fri, 2 Apr 2021 15:34:13 -0400 From: "Theodore Ts'o" To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, Matthew Wilcox , linux-ext4@vger.kernel.org Subject: Re: [PATCH 0/3 RFC] fs: Hole punch vs page cache filling races Message-ID: References: <20210120160611.26853-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210120160611.26853-1-jack@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jan 20, 2021 at 05:06:08PM +0100, Jan Kara wrote: > > Amir has reported [1] a that ext4 has a potential issues when reads can race > with hole punching possibly exposing stale data from freed blocks or even > corrupting filesystem when stale mapping data gets used for writeout. The > problem is that during hole punching, new page cache pages can get instantiated > in a punched range after truncate_inode_pages() has run but before the > filesystem removes blocks from the file. In principle any filesystem > implementing hole punching thus needs to implement a mechanism to block > instantiating page cache pages during hole punching to avoid this race. This is > further complicated by the fact that there are multiple places that can > instantiate pages in page cache. We can have regular read(2) or page fault > doing this but fadvise(2) or madvise(2) can also result in reading in page > cache pages through force_page_cache_readahead(). What's the current status of this patch set? I'm going through pending patches and it looks like folks don't like Jan's proposed solution. What are next steps? Thanks, - Ted