[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190917090233.GB29487@infradead.org>
Date: Tue, 17 Sep 2019 02:02:33 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Ritesh Harjani <riteshh@...ux.ibm.com>
Cc: Matthew Bobrowski <mbobrowski@...browski.org>,
Christoph Hellwig <hch@...radead.org>, tytso@....edu,
jack@...e.cz, adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org, david@...morbit.com,
darrick.wong@...cle.com
Subject: Re: [PATCH v3 5/6] ext4: introduce direct IO write path using iomap
infrastructure
On Tue, Sep 17, 2019 at 02:30:15PM +0530, Ritesh Harjani wrote:
> So if we have a delayed buffered write to a file,
> in that case we first only update inode->i_size and update
> i_disksize at writeback time
> (i.e. during block allocation).
> In that case when we call for ext4_dio_write_iter
> since offset + len > i_disksize, we call for ext4_update_i_disksize().
>
> Now if writeback for some reason failed. And the system crashes, during the
> DIO writes, after the blocks are allocated. Then during reboot we may have
> an inconsistent inode, since we did not add the inode into the
> orphan list before we updated the inode->i_disksize. And journal replay
> may not succeed.
>
> 1. Can above actually happen? I am still not able to figure out the
> race/inconsistency completely.
> 2. Can you please help explain under what other cases
> it was necessary to call ext4_update_i_disksize() in DIO write paths?
> 3. When will i_disksize be out-of-sync with i_size during DIO writes?
None of the above seems new in this patchset, does it? That being said
I found the early size update odd. XFS updates the on-disk size only
at I/O completion time to deal with various races including the
potential exposure of stale data.
Powered by blists - more mailing lists