Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp35835pxf; Tue, 6 Apr 2021 14:14:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+CQCA6O5/vMz31ldvBgXJlItLO1Eo/hy7O3/Hr4tNDWswZ0Zy0NQFsR8dU/W34AYRQGym X-Received: by 2002:a05:6402:ca6:: with SMTP id cn6mr340105edb.169.1617743649792; Tue, 06 Apr 2021 14:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617743649; cv=none; d=google.com; s=arc-20160816; b=0CtCGvjM4trqOjEwb0H8ZPA761wpj6UCw9DKkhmLuC0qe+0n5mePFgm5OXNaYs2DLq CwYtCdrUE9VgaXWWkctFHIpn9k0QjOKRyMYJNN3KQkmvraNdc5F3G8t7GDbaawfUAe3i yD0cg/J6b3YWib6VFKZ6fuJZAnExfoZIrKobdqJQ53uqh+F9WaQbItUEZVvmtrs/6J6l K7O1Ot/k8OzpcgiE9vDK4zxPocmeF1/Mm7+c054xTlp1g8tHBabzqcR7Di1wQ2mieJp4 eXpAoU+0kb0q081/+P7FiniF73D2WlC+kgsFmJ1WgTSrCC43L0XQ/fsCjpyYLsrg0XWm i+NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=6YhuVAtYWatJm6+MQlK60MdHf7gMxng1KwJFbTliUxY=; b=Xjs/a5gvZ8h/GRqbX2spkNB2CnmrvXHoyN9ZFgrDqm3EwJtpo2KevmNlobrYyg/0hs 5ssfn2/lGefyG5CsywmU54UCdWfkPEoN06tNErjgdT7hBm7H8GDhuKtiP9sckjkHS+ia sehABmeRb3wyN4oGXX6IeqbW12G08E1bpgUNaisyIN2UhzzC2F9zeD+ujT3Ik1U+WWB8 zYDGAP7TAUfxmT/f/l6sdtoucnSWOllef1aPFWzZVb6YAHYLs+UStIRCBOLwLNanOVoQ dXaGCNxAeVOMQF0MeAlMbDZSyIXQNdw1JMUVFJF7JpIaNYNKvIw8vb2GIDUZzzfi2+T7 tTzg== 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 i14si18147923eje.519.2021.04.06.14.13.43; Tue, 06 Apr 2021 14:14:09 -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 S243227AbhDFMRM (ORCPT + 99 others); Tue, 6 Apr 2021 08:17:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:35868 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243195AbhDFMRL (ORCPT ); Tue, 6 Apr 2021 08:17:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0FE3BB15C; Tue, 6 Apr 2021 12:17:03 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id CDD451F2B77; Tue, 6 Apr 2021 14:17:02 +0200 (CEST) Date: Tue, 6 Apr 2021 14:17:02 +0200 From: Jan Kara To: Theodore Ts'o Cc: Jan Kara , 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: <20210406121702.GB19407@quack2.suse.cz> References: <20210120160611.26853-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri 02-04-21 15:34:13, Theodore Ts'o wrote: > 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? Note that I did post v2 here: https://lore.kernel.org/linux-fsdevel/20210208163918.7871-1-jack@suse.cz/ It didn't get much comments though. I guess I'll rebase the series, include the explanations I've added in my reply to Dave and resend. Honza -- Jan Kara SUSE Labs, CR