OSDN Git Service

xfs: ensure we mark all inodes in a freed cluster XFS_ISTALE
authorDave Chinner <dchinner@redhat.com>
Tue, 24 Aug 2010 01:42:41 +0000 (11:42 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:36:06 +0000 (13:36 -0700)
commitefa1f7cba7a728169b7c797dc66cab2a9d8526de
tree1c26b2416a565cd9ab3bf461043a10884a9143bd
parentcf4f5ceca8d72ee794410cb26dc4b64b11d4965f
xfs: ensure we mark all inodes in a freed cluster XFS_ISTALE

commit 5b3eed756cd37255cad1181bd86bfd0977e97953 upstream.

Under heavy load parallel metadata loads (e.g. dbench), we can fail
to mark all the inodes in a cluster being freed as XFS_ISTALE as we
skip inodes we cannot get the XFS_ILOCK_EXCL or the flush lock on.
When this happens and the inode cluster buffer has already been
marked stale and freed, inode reclaim can try to write the inode out
as it is dirty and not marked stale. This can result in writing th
metadata to an freed extent, or in the case it has already
been overwritten trigger a magic number check failure and return an
EUCLEAN error such as:

Filesystem "ram0": inode 0x442ba1 background reclaim flush failed with 117

Fix this by ensuring that we hoover up all in memory inodes in the
cluster and mark them XFS_ISTALE when freeing the cluster.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/xfs/xfs_inode.c