Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4829402ybp; Mon, 7 Oct 2019 14:47:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwK/bGXj0WZKyyCp1S6l94igAmiFsBpISGo24Kvz25yga00CoiBhv+qAeEsJvVU0wYNIm0 X-Received: by 2002:a17:906:4bc3:: with SMTP id x3mr25869076ejv.200.1570484828084; Mon, 07 Oct 2019 14:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570484828; cv=none; d=google.com; s=arc-20160816; b=vWNL6tWC1DKysttOjCCX92FZCA3GwV1fYsS5V/nhkgBIt4HlXW87fww1OVDjwCbo9j W8FOPP91wBwuY6kE9mMKlRHZnTgeUra1rkWFLkyIxTwZlc6KLFaSu3aJoxIvkaJDnG8b svwHxGUNHwSFHUlEXjnqyPFaTe9wfL5303kqHgeJ2jzDT9vJ0YVq3I5G2K/YRNM64SfU SzLfv1lFHopZlsU1oLfTa+28+sWevxng2uxDy388SoOlomq1IAjNCXS5dDyHxxuBzovy xtZXaRx8M92nt3Aey1izC7GzzwI+E2ldjQFCK8YpF3cTupXk4bOjJZj874co2GBf+Eo9 3+JA== 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=B1qqXCdPCMcfW/h37CigO/84+JZpM3uj1znhGLK2SFU=; b=Cy46680GQxxC4hYMLshUF1tHTUK35/bYTJMKJVzmpYw5P8KHZoOERJSOzqg9w7AYY+ +ejPMGVLV3lrNROtmJtYJetyAcDiXxYtcI3AWIuLcKJe7sm+KXQNTTFStHv2tfJzJH5X k6WQl/ftMF/nIQa8d17Um6xWkK3V9TOrrGcbh0guN/uidFzQbWDEUzCsleB0qiZBQ1cf aPZbwhJUh6099gcPswrAKUX4m2DOb1BoMYuFpB8Nj14fD0l1af2ZzZKMJ/c1m0crW7F/ YKAcdQeaeKogVdoPmqgNHMHjmXPEMyKXGgFFcIGaYtmluokvMpWcC/jv6bYorOWySaGw HRmg== 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 c9si8519692eds.211.2019.10.07.14.46.44; Mon, 07 Oct 2019 14:47:08 -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 S1729252AbfJGVqg (ORCPT + 99 others); Mon, 7 Oct 2019 17:46:36 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:56222 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728422AbfJGVqg (ORCPT ); Mon, 7 Oct 2019 17:46:36 -0400 Received: from dread.disaster.area (pa49-181-226-196.pa.nsw.optusnet.com.au [49.181.226.196]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 5B0DD363506; Tue, 8 Oct 2019 08:46:34 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.2) (envelope-from ) id 1iHaps-0001j3-Pf; Tue, 08 Oct 2019 08:46:32 +1100 Date: Tue, 8 Oct 2019 08:46:32 +1100 From: Dave Chinner To: Christoph Hellwig Cc: "Darrick J . Wong" , Damien Le Moal , Andreas Gruenbacher , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/11] iomap: zero newly allocated mapped blocks Message-ID: <20191007214632.GA16973@dread.disaster.area> References: <20191006154608.24738-1-hch@lst.de> <20191006154608.24738-6-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191006154608.24738-6-hch@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=dRuLqZ1tmBNts2YiI0zFQg==:117 a=dRuLqZ1tmBNts2YiI0zFQg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=XobE76Q3jBoA:10 a=yPCof4ZbAAAA:8 a=7-415B0cAAAA:8 a=PhxamUq2ceSyVfUHfJsA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 06, 2019 at 05:46:02PM +0200, Christoph Hellwig wrote: > File systems like gfs2 don't support delayed allocations or unwritten > extents and thus allocate normal mapped blocks to fill holes. To > cover the case of such file systems allocating new blocks to fill holes > also zero out mapped blocks with the new flag. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Darrick J. Wong > Signed-off-by: Darrick J. Wong > --- > fs/iomap/buffered-io.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index 23cc308f971d..4132c0cccb0a 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -207,6 +207,14 @@ iomap_read_inline_data(struct inode *inode, struct page *page, > SetPageUptodate(page); > } > > +static inline bool iomap_block_needs_zeroing(struct inode *inode, > + struct iomap *iomap, loff_t pos) > +{ > + return iomap->type != IOMAP_MAPPED || > + (iomap->flags & IOMAP_F_NEW) || > + pos >= i_size_read(inode); This is a change of logic - why is the IOMAP_F_NEW check added here and what bug does it fix? Cheers, Dave. -- Dave Chinner david@fromorbit.com