Date: Wed, Nov 16 2005 10:06:27 +1100
From: Felix Blyakher <felixb@sgi.com>
References: 132358, SGI:PV943821
Subject: fix xfs_finish_reclaim_all umount deadlock

Tight loop in xfs_finish_reclaim_all prevented the xfslogd
to run its queue of IO completion callbacks, thus creating
the deadlock between umount and xfslogd.
Breaking the loop solves the problem.

Acked-by: Andreas Gruenbacher <agruen@suse.de>

===========================================================================
Index: xfs_vnodeops.c
===========================================================================

--- a/fs/xfs/xfs_vnodeops.c	2005-11-16 09:26:59.000000000 +1100
+++ b/fs/xfs/xfs_vnodeops.c	2005-11-16 09:26:59.000000000 +1100
@@ -3945,8 +3945,9 @@ xfs_finish_reclaim_all(xfs_mount_t *mp, 
 				}
 			}
 			XFS_MOUNT_IUNLOCK(mp);
-			xfs_finish_reclaim(ip, noblock,
-				XFS_IFLUSH_DELWRI_ELSE_ASYNC);
+			if (xfs_finish_reclaim(ip, noblock,
+					XFS_IFLUSH_DELWRI_ELSE_ASYNC))
+				delay(1);
 			purged = 1;
 			break;
 		}
