[Top] [All Lists]

Re: [Fwd: [PATCH] Fix speculative allocation beyond eof]

To: Lachlan McIlroy <lachlan@xxxxxxx>
Subject: Re: [Fwd: [PATCH] Fix speculative allocation beyond eof]
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 17 Dec 2008 09:24:42 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <49378444.9040108@xxxxxxx>
References: <49378444.9040108@xxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, Dec 04, 2008 at 06:18:28PM +1100, Lachlan McIlroy wrote:
> Speculative allocation beyond eof doesn't work properly.  It was broken some
> time ago after a code cleanup that moved what is now 
> xfs_iomap_eof_align_last_fsb()
> and xfs_iomap_eof_want_preallocate() out of xfs_iomap_write_delay() into
> separate functions.  The code used to use the current file size in various 
> checks
> but got changed to be max(file_size, i_new_size).  Since i_new_size is the 
> result
> of 'offset + count' then in xfs_iomap_eof_want_preallocate() the check for
> '(offset + count) <= isize' will always be true.
> ie if 'offset + count' is > ip->i_size then isize will be i_new_size and 
> equal to
> 'offset + count'.
> This change fixes all the places that used to use the current file size.

Looks good, we should be using the current i_size everywhere.

<Prev in Thread] Current Thread [Next in Thread>