xfs
[Top] [All Lists]

Re: drastic changes to allocsize semantics in or around 2.6.38?

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: drastic changes to allocsize semantics in or around 2.6.38?
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 23 May 2011 05:01:44 -0400
Cc: Matthias Schniedermeyer <ms@xxxxxxx>, Marc Lehmann <schmorp@xxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20110523012034.GA32466@dastard>
References: <20110520005510.GA15348@xxxxxxxxxx> <20110520025659.GO32466@dastard> <20110520154920.GD5828@xxxxxxxxxx> <20110521004544.GT32466@dastard> <20110521013604.GC10971@xxxxxxxxxx> <20110521031537.GV32466@dastard> <20110521041652.GA18375@xxxxxxxxxx> <20110522020024.GZ32466@dastard> <20110522075955.GA2341@xxxxxxx> <20110523012034.GA32466@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, May 23, 2011 at 11:20:34AM +1000, Dave Chinner wrote:
> 
> The state used to track dirty inode release calls is not reset when
> an inode is reallocated and reused from the reclaimable state. This
> leads to specualtive preallocation not being truncated away in the
> expected manner for local files until the inode is subsequently
> truncated, freed or cycles out of the cache.
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_iget.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
> index cb9b6d1..e75e757 100644
> --- a/fs/xfs/xfs_iget.c
> +++ b/fs/xfs/xfs_iget.c
> @@ -241,6 +241,13 @@ xfs_iget_cache_hit(
>                */
>               ip->i_flags |= XFS_IRECLAIM;
>  
> +             /*
> +              * clear the dirty release state as we are now effectively a
> +              * new inode and so we need to treat speculative preallocation
> +              * accordingly.
> +              */
> +             ip->i_flags &= ~XFS_IDIRTY_RELEASE;

Btw, don't we need to clear even more flags here?  To me it seems we
need to clear XFS_ISTALE, XFS_IFILESTREAM and XFS_ITRUNCATED as well.

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