[Top] [All Lists]

Re: [PATCH] xfs: xfs_release don't free eofblocks with extsize hint

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: xfs_release don't free eofblocks with extsize hint
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 19 Jun 2012 03:48:13 -0400
Cc: Ben Myers <bpm@xxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20120612011102.GJ22848@dastard>
References: <20120611192948.GX29173@xxxxxxx> <20120612011102.GJ22848@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Jun 12, 2012 at 11:11:02AM +1000, Dave Chinner wrote:
> Alternatively, (and I think a better solution) is to treat files
> with extent size hints on them exactly the same as files with
> preallocation on them. i.e. in xfs_set_diflags() we set
> XFS_DIFLAG_PREALLOC at the same time we set the XFS_DIFLAG_EXTSIZE,
> and then all our truncate logic just works as expected for
> physical preallocation beyond EOF on extsize hint files without
> changing anything else....

I think that is a much better approach.  The user explicitly asked to
do allocation in the specified unit, so we should not truncate it down.

On something slightly related:  Currently the calls to
xfs_free_eofblocks in xfs_release and in xfs_inactive are guarded by
similar but not quite the same checks on the inode type/flags/allocated
blocks, etc.  It would be really good to factor the common parts into
a helper, and then document why the other checks need to be different.

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