]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: reset inode per-lifetime state when recycling it
authorDave Chinner <dchinner@redhat.com>
Thu, 23 Jun 2011 01:34:59 +0000 (01:34 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 24 Jun 2011 03:13:31 +0000 (22:13 -0500)
commit0ad764325ebb9ab3c5aa97eaf537c29752f8b452
treef245e607bb2e999d046d777a6abd84c422c86f41
parent320c4a9bc28c607bcb532ebc59131e5a5f19e4bf
xfs: reset inode per-lifetime state when recycling it

XFS inodes has several per-lifetime state fields that determine the
behaviour of the inode. These state fields are not all reset when an
inode is reused from the reclaimable state.

This can lead to unexpected behaviour of the new inode such as
speculative 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. It can also lead to an inode being
considered to be a filestream inode or having been truncated when
that is not the case.

Rework the reinitialisation of the inode when it is recycled to
ensure that it is pristine before it is reused. While there, also
fix the resetting of state flags in the recycling error paths so the
inode does not become unreclaimable.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.h