Date: Mon, May 29 2006 14:31:56 +1000
From: David Chinner <dgc@sgi.com>
References: 179117, SGI:PV952967
Subject: Don't dirty the inode if it being freed in xfs_iunpin

Stop a BUG from occurring in generic_delete_inode by preventing
transaction completion from marking the inode dirty while it is being
cleaned up on its way out of the system.

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

Index: linux-2.6.5-SLES9_SP4_BRANCH/fs/xfs/xfs_inode.c
===================================================================
--- linux-2.6.5-SLES9_SP4_BRANCH.orig/fs/xfs/xfs_inode.c
+++ linux-2.6.5-SLES9_SP4_BRANCH/fs/xfs/xfs_inode.c
@@ -2879,7 +2879,8 @@ xfs_iunpin(
 			if (vp) {
 				struct inode	*inode = LINVFS_GET_IP(vp);
 
-				if (!(inode->i_state & I_NEW))
+				if (!(inode->i_state &
+						(I_NEW|I_FREEING|I_CLEAR)))
 					mark_inode_dirty_sync(inode);
 			}
 		}
