aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@sgi.com>2008-06-22 23:23:57 -0400
committerNiv Sardi <xaiki@debian.org>2008-07-28 02:58:54 -0400
commit7f871d5d1b9b126c1a0cece737a37c6980c988e3 (patch)
treec5eda9a03a16da85786bf15c7f31f5b23bc5492b /fs/xfs/xfs_vnodeops.c
parentad9b463aa206b8c8f0bab378cf7c090c1a9a8e34 (diff)
[XFS] make inode reclaim wait for log I/O to complete
During a forced shutdown a xfs inode can be destroyed before log I/O involving that inode is complete. We need to wait for the inode to be unpinned before tearing it down. Version 2 cleans up the code a bit by relying on xfs_iflush() to do the unpinning and forced shutdown check. SGI-PV: 981240 SGI-Modid: xfs-linux-melb:xfs-kern:31326a Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: David Chinner <dgc@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index b6a065eb25a5..d76565bfcb7b 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -3260,7 +3260,6 @@ xfs_finish_reclaim(
3260{ 3260{
3261 xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); 3261 xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino);
3262 bhv_vnode_t *vp = XFS_ITOV_NULL(ip); 3262 bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
3263 int error;
3264 3263
3265 if (vp && VN_BAD(vp)) 3264 if (vp && VN_BAD(vp))
3266 goto reclaim; 3265 goto reclaim;
@@ -3303,29 +3302,16 @@ xfs_finish_reclaim(
3303 xfs_iflock(ip); 3302 xfs_iflock(ip);
3304 } 3303 }
3305 3304
3306 if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { 3305 /*
3307 if (ip->i_update_core || 3306 * In the case of a forced shutdown we rely on xfs_iflush() to
3308 ((ip->i_itemp != NULL) && 3307 * wait for the inode to be unpinned before returning an error.
3309 (ip->i_itemp->ili_format.ilf_fields != 0))) { 3308 */
3310 error = xfs_iflush(ip, sync_mode); 3309 if (xfs_iflush(ip, sync_mode) == 0) {
3311 /* 3310 /* synchronize with xfs_iflush_done */
3312 * If we hit an error, typically because of filesystem 3311 xfs_iflock(ip);
3313 * shutdown, we don't need to let vn_reclaim to know 3312 xfs_ifunlock(ip);
3314 * because we're gonna reclaim the inode anyway.
3315 */
3316 if (error) {
3317 xfs_iunlock(ip, XFS_ILOCK_EXCL);
3318 goto reclaim;
3319 }
3320 xfs_iflock(ip); /* synchronize with xfs_iflush_done */
3321 }
3322
3323 ASSERT(ip->i_update_core == 0);
3324 ASSERT(ip->i_itemp == NULL ||
3325 ip->i_itemp->ili_format.ilf_fields == 0);
3326 } 3313 }
3327 3314
3328 xfs_ifunlock(ip);
3329 xfs_iunlock(ip, XFS_ILOCK_EXCL); 3315 xfs_iunlock(ip, XFS_ILOCK_EXCL);
3330 3316
3331 reclaim: 3317 reclaim: