Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1293882ybg; Fri, 18 Oct 2019 15:21:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaGgdvHnXU3LBfrGYYyhyXon45gIlYFgOrfGumNP5AxfaC0mliArrVvCBY721nyIJcYqSc X-Received: by 2002:a05:6402:13d6:: with SMTP id a22mr12330241edx.165.1571437289743; Fri, 18 Oct 2019 15:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437289; cv=none; d=google.com; s=arc-20160816; b=WuFsn3YHVuvsaZMQosuPT705pqQ6afEANNLzZvCQs5dhNsstakqdj8RNPWSR0M5d1D y2/V7UZRf6yHEtUUFI8k2sPeTMjUMa9YTWmNFLvaPg/kWLfdYscLdI5qEyYXQYMKqpSM YGWOIMOpx0Xr0uQPkfJo9tGh+Z62Q4TDM8AD3BzGNTL1OMbK04pBkh8n8NitcVKFzwxR KnXuz+OnZo93fy5XZ+wWLCIxLrtFnnCFr+l9y7GKcjB/VHsN2jnYpxJ15Y2d6OIL3k6M O4z+r/0jx+jWaYGAy9s8/7mifFk89sb7B+Hf4wAfKsBgnbMlnqzvfCCfo1EiDCIqpqC/ oSPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9Wk4g2h0+gK8B+hi2GiRi0cNz3GlzyRuAibWj9FNvWQ=; b=o2qLZqi56zvwQUou87vbFnIFAl09G3KafUNFgH9bd7OTdLY//mMo4HTjaNeUPyGwHn 9F/qFFRI4vk0SErzVgH84P6/uA9I/R4BH/3NeU4TBUtiVj3pxdSCg4vINLkf1Pn8IZ34 AUSzVJBTyMCqbVQlgONdYh7DAz3pRTA57UxnVH1KLMZRDLIyStAzAHfPdnJ7GEoJJXmC W2K3Vw80wyWIiXHJvQT1HAfI37urz9OAnHFjnEBUr7OMhYY1hSubElaSIhmc9vtn2hb9 q5su9tYmuKz/OrpRppwhqf5RTX+o5w323juib1uRzw/iLijiXFX3esTqwHZgxrkqJxCN dwXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 27si4673202edz.186.2019.10.18.15.21.06; Fri, 18 Oct 2019 15:21:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503687AbfJQV4S (ORCPT + 99 others); Thu, 17 Oct 2019 17:56:18 -0400 Received: from mail104.syd.optusnet.com.au ([211.29.132.246]:46033 "EHLO mail104.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391375AbfJQV4S (ORCPT ); Thu, 17 Oct 2019 17:56:18 -0400 Received: from dread.disaster.area (pa49-181-198-88.pa.nsw.optusnet.com.au [49.181.198.88]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id A572843F0F3; Fri, 18 Oct 2019 08:56:14 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.2) (envelope-from ) id 1iLDkj-0002Ck-BA; Fri, 18 Oct 2019 08:56:13 +1100 Date: Fri, 18 Oct 2019 08:56:13 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: Christoph Hellwig , Damien Le Moal , Andreas Gruenbacher , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Chinner Subject: Re: [PATCH 01/14] iomap: iomap that extends beyond EOF should be marked dirty Message-ID: <20191017215613.GN16973@dread.disaster.area> References: <20191017175624.30305-1-hch@lst.de> <20191017175624.30305-2-hch@lst.de> <20191017183917.GL13108@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191017183917.GL13108@magnolia> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 a=ocld+OpnWJCUTqzFQA3oTA==:117 a=ocld+OpnWJCUTqzFQA3oTA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=XobE76Q3jBoA:10 a=20KFwNOVAAAA:8 a=7-415B0cAAAA:8 a=ckDNvsoUsni0MSp1FtYA:9 a=CjuIK1q_8ugA:10 a=igBNqPyMv6gA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 11:39:17AM -0700, Darrick J. Wong wrote: > On Thu, Oct 17, 2019 at 07:56:11PM +0200, Christoph Hellwig wrote: > > From: Dave Chinner > > > > When doing a direct IO that spans the current EOF, and there are > > written blocks beyond EOF that extend beyond the current write, the > > only metadata update that needs to be done is a file size extension. > > > > However, we don't mark such iomaps as IOMAP_F_DIRTY to indicate that > > there is IO completion metadata updates required, and hence we may > > fail to correctly sync file size extensions made in IO completion > > when O_DSYNC writes are being used and the hardware supports FUA. > > > > Hence when setting IOMAP_F_DIRTY, we need to also take into account > > whether the iomap spans the current EOF. If it does, then we need to > > mark it dirty so that IO completion will call generic_write_sync() > > to flush the inode size update to stable storage correctly. > > > > Signed-off-by: Dave Chinner > > Signed-off-by: Christoph Hellwig > > Looks ok, but need fixes tag. Also, might it be wise to split off the > ext4 section into a separate patch so that it can be backported > separately? I 've done a bit more digging on this, and the ext4 part is not needed for DAX as IOMAP_F_DIRTY is only used in the page fault path and hence can't change the file size. As such, this only affects direct IO. Hence the ext4 hunk can be added to the ext4 iomap-dio patchset that is being developed rather than being in this patch. Fixes: 3460cac1ca76 ("iomap: Use FUA for pure data O_DSYNC DIO writes") Cheers, Dave. -- Dave Chinner david@fromorbit.com