aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2010-01-01 21:39:40 -0500
committerAlex Elder <aelder@sgi.com>2010-01-10 13:22:00 -0500
commit44e08c45cc14e6190a424be8d450070c8e508fad (patch)
treef0938a953d0bce87cade91ec753293c305925296 /fs/xfs/xfs_inode.c
parentd6d59bada372bcf8bd36c3bbc71c485c29dd2a4b (diff)
xfs: Don't flush stale inodes
Because inodes remain in cache much longer than inode buffers do under memory pressure, we can get the situation where we have stale, dirty inodes being reclaimed but the backing storage has been freed. Hence we should never, ever flush XFS_ISTALE inodes to disk as there is no guarantee that the backing buffer is in cache and still marked stale when the flush occurs. Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index ce278b3ae7fc..391d36b0e68c 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2841,10 +2841,14 @@ xfs_iflush(
2841 mp = ip->i_mount; 2841 mp = ip->i_mount;
2842 2842
2843 /* 2843 /*
2844 * If the inode isn't dirty, then just release the inode 2844 * If the inode isn't dirty, then just release the inode flush lock and
2845 * flush lock and do nothing. 2845 * do nothing. Treat stale inodes the same; we cannot rely on the
2846 * backing buffer remaining stale in cache for the remaining life of
2847 * the stale inode and so xfs_itobp() below may give us a buffer that
2848 * no longer contains inodes below. Doing this stale check here also
2849 * avoids forcing the log on pinned, stale inodes.
2846 */ 2850 */
2847 if (xfs_inode_clean(ip)) { 2851 if (xfs_inode_clean(ip) || xfs_iflags_test(ip, XFS_ISTALE)) {
2848 xfs_ifunlock(ip); 2852 xfs_ifunlock(ip);
2849 return 0; 2853 return 0;
2850 } 2854 }