Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4851197ybp; Mon, 7 Oct 2019 15:09:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMriAaKNgKLEx36xM7Q16eN6hfPND0p2tIsYHLzl2UoaOUnW7KIDErJTFj4NAKA5HkG/Oq X-Received: by 2002:a05:6402:1212:: with SMTP id c18mr31290119edw.259.1570486163824; Mon, 07 Oct 2019 15:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570486163; cv=none; d=google.com; s=arc-20160816; b=he1HsM9QJ4ZBp7DTvWSeSeR/BCt1GhxhhlZ7NOyN8J2NSRidevA4JDKvavn8niGZGi OUHNTq+5qwvRqAFX1Snpzu6bmM9A+uoVqwLmHwQH64M2MKA3wnGI+DkSSJB5n1gdT1qQ oL5TgBcD/V45z/7OGklcMx5nhbDlCFzjnjiXIoNnZdv3udDyaL+eKwdjnsUDelfrAxn0 bSw6rMcTdHS641lq0Drq0uSI0pw0hp/E3/wv+Ryyjrt2Vf/LbgE9Cq92WvKDQ98hnvwv 0Lu9pIp2jH2K2X4dhO2iVNHQi58JAfVKcvmgdoOL2AqOuvf4jXLhZAicLy6AncUZOea8 VUxA== 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=5NiTPiNLRQbRpZy7PkmzepSsYaKfP+ws4/Lcq9r7Z7U=; b=EJTcT0FN7/z4PSQvxq1Tb7674YIIs3G8SVhpqPXE/ZmdDt2Je9qNVDxT9jFfjnDieX 3WpWokMno5xP9d0fxf0qOjbGOxjt4w4TMl/WOep4iASGcZmpMFXOR1X9ns+p9Vo/tx6w UoV5zSlQ56ORvaNOmWEtsDRZ4IwyTnLHmDPwkcXc01MMZYqw0c+r6Nb3unFHDyak3VUn u7+hkGJytSKUawBDX6BqpFAWJmUXLk/VmlEnEbfh06EEfW0lO/ZqeV8l/yymxqXi+AAX ya5T9NdbGcCMOule1ekAa3IC88VJK6kuMCg5cMj3En39QZSypjOWOWec4XPhGTIz3rR8 6l7w== 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 v26si7776342ejw.276.2019.10.07.15.09.00; Mon, 07 Oct 2019 15:09:23 -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 S1729291AbfJGWIl (ORCPT + 99 others); Mon, 7 Oct 2019 18:08:41 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:44903 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728422AbfJGWIk (ORCPT ); Mon, 7 Oct 2019 18:08:40 -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 968DC363D6F; Tue, 8 Oct 2019 09:08:38 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.2) (envelope-from ) id 1iHbBF-0001tZ-HL; Tue, 08 Oct 2019 09:08:37 +1100 Date: Tue, 8 Oct 2019 09:08:37 +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: <20191007220837.GD16973@dread.disaster.area> References: <20191006154608.24738-1-hch@lst.de> <20191006154608.24738-6-hch@lst.de> <20191007214632.GA16973@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191007214632.GA16973@dread.disaster.area> 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=pGzP--_MTh1zkI28PPEA: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 Tue, Oct 08, 2019 at 08:46:32AM +1100, Dave Chinner wrote: > 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? Sorry, brain-fart here - that's what this patch is adding, it's not a pure factoring patch.... :/ Cheers, Dave. -- Dave Chinner david@fromorbit.com