From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8BE5ECE58E for ; Thu, 17 Oct 2019 12:29:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AABF42064B for ; Thu, 17 Oct 2019 12:29:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394123AbfJQM3X (ORCPT ); Thu, 17 Oct 2019 08:29:23 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57849 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728190AbfJQM3X (ORCPT ); Thu, 17 Oct 2019 08:29:23 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-98.corp.google.com [104.133.0.98] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x9HCTBPg028552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 08:29:12 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 94880420458; Thu, 17 Oct 2019 08:29:11 -0400 (EDT) Date: Thu, 17 Oct 2019 08:29:11 -0400 From: "Theodore Y. Ts'o" To: Dave Chinner Cc: linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Bobrowski Subject: Re: [PATCH v2] iomap: iomap that extends beyond EOF should be marked dirty Message-ID: <20191017122911.GC25548@mit.edu> References: <20191016051101.12620-1-david@fromorbit.com> <20191016060604.GH16973@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191016060604.GH16973@dread.disaster.area> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Oct 16, 2019 at 05:06:04PM +1100, Dave Chinner wrote: > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 516faa280ced..e9dc52537e5b 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3523,9 +3523,16 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length, > return ret; > } > > + /* > + * Writes that span EOF might trigger an IO size update on completion, > + * so consider them to be dirty for the purposes of O_DSYNC even if > + * there is no other metadata changes being made or are pending here. > + */ > iomap->flags = 0; > - if (ext4_inode_datasync_dirty(inode)) > + if (ext4_inode_datasync_dirty(inode) || > + offset + length > i_size_read(inode)) > iomap->flags |= IOMAP_F_DIRTY; > + > iomap->bdev = inode->i_sb->s_bdev; > iomap->dax_dev = sbi->s_daxdev; > iomap->offset = (u64)first_block << blkbits; Ext4 is not currently using iomap for any kind of writing right now, so perhaps this should land via Matthew's patchset? - Ted