[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191017122911.GC25548@mit.edu>
Date: Thu, 17 Oct 2019 08:29:11 -0400
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Dave Chinner <david@...morbit.com>
Cc: linux-xfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
Matthew Bobrowski <mbobrowski@...browski.org>
Subject: Re: [PATCH v2] iomap: iomap that extends beyond EOF should be marked
dirty
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
Powered by blists - more mailing lists