[Top] [All Lists]

Re: [PATCH 2/3] xfs: clear XFS_IDIRTY_RELEASE on truncate down

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/3] xfs: clear XFS_IDIRTY_RELEASE on truncate down
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 23 Jun 2011 17:21:41 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1308792901-22880-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1308792901-22880-1-git-send-email-david@xxxxxxxxxxxxx> <1308792901-22880-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Jun 23, 2011 at 11:35:00AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> When an inode is truncated down, speculative preallocation is
> removed from the inode. This should also reset the state bits for
> controlling whether preallocation is subsequently removed when the
> file is next closed. The flag is not being cleared, so repeated
> operations on a file that first involve a truncate (e.g. multiple
> repeated dd invocations on a file) give different file layouts for
> the second and subsequent invocations.
> Fix this by clearing the XFS_IDIRTY_RELEASE state bit when the
> XFS_ITRUNCATED bit is detected in xfs_release() and hence ensure
> that speculative delalloc is removed on files that have been
> truncated down.
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

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