]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: clear XFS_IDIRTY_RELEASE on truncate down
authorDave Chinner <dchinner@redhat.com>
Thu, 23 Jun 2011 01:35:00 +0000 (01:35 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 24 Jun 2011 03:13:46 +0000 (22:13 -0500)
commitb0665c384622a60453f48cf19a37e788cb5d5e6a
tree2e8137eeaac9528f29fbab770fdf078a7496d5b5
parent0ad764325ebb9ab3c5aa97eaf537c29752f8b452
xfs: clear XFS_IDIRTY_RELEASE on truncate down

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@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/xfs_vnodeops.c