xfs
[Top] [All Lists]

[PATCH] Move vn_iowait() earlier in the reclaim path

To: xfs@xxxxxxxxxxx, xfs-dev <xfs-dev@xxxxxxx>
Subject: [PATCH] Move vn_iowait() earlier in the reclaim path
From: Lachlan McIlroy <lachlan@xxxxxxx>
Date: Tue, 05 Aug 2008 16:43:29 +1000
Reply-to: lachlan@xxxxxxx
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.16 (X11/20080707)
Currently by the time we get to vn_iowait() in xfs_reclaim() we have already
gone through xfs_inactive()/xfs_free() and recycled the inode.  Any I/O
completions still running (file size updates and unwritten extent conversions)
may be working on an inode that is no longer valid.

--- a/fs/xfs/linux-2.6/xfs_super.c      2008-08-05 16:27:57.000000000 +1000
+++ b/fs/xfs/linux-2.6/xfs_super.c      2008-08-05 13:54:41.000000000 +1000
@@ -935,6 +935,7 @@ xfs_fs_clear_inode(
                XFS_STATS_INC(vn_reclaim);
                XFS_STATS_DEC(vn_active);

+               vn_iowait(ip);
                xfs_inactive(ip);
                xfs_iflags_clear(ip, XFS_IMODIFIED);
                if (xfs_reclaim(ip))
--- a/fs/xfs/xfs_vnodeops.c     2008-08-05 16:27:57.000000000 +1000
+++ b/fs/xfs/xfs_vnodeops.c     2008-08-05 13:54:43.000000000 +1000
@@ -2802,8 +2802,6 @@ xfs_reclaim(
                return 0;
        }

-       vn_iowait(ip);
-
        ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0);

        /*


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