Here is a patch that removes the XFS-internal writing of data in sync and instead trusts the VFS code to get it right, and also does the ioend_wait under a lock, to protect against new pending I/Os showing up. It passed a single xfsqa run so far, so at least it won't blow up completely. Can you check if that helps with your livelock test case? (And yes, I should go and try it myself. Will do as soon as I'll get a bit more time). Index: xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2011-06-09 14:17:06.952532698 +0200 +++ xfs/fs/xfs/linux-2.6/xfs_super.c 2011-06-09 14:17:36.742531190 +0200 @@ -991,7 +991,7 @@ xfs_fs_write_inode( * ->sync_fs call do that for thus, which reduces the number * of synchronous log foces dramatically. */ - xfs_ioend_wait(ip); +// xfs_ioend_wait(ip); xfs_ilock(ip, XFS_ILOCK_SHARED); if (ip->i_update_core) { error = xfs_log_inode(ip); Index: xfs/fs/xfs/linux-2.6/xfs_sync.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_sync.c 2011-06-09 14:16:59.575866405 +0200 +++ xfs/fs/xfs/linux-2.6/xfs_sync.c 2011-06-09 14:22:31.675849591 +0200 @@ -215,6 +215,19 @@ xfs_inode_ag_iterator( } STATIC int +xfs_wait_ioend_cb( + struct xfs_inode *ip, + struct xfs_perag *pag, + int flags) +{ + xfs_ilock(ip, XFS_IOLOCK_SHARED); + xfs_ioend_wait(ip); + xfs_iunlock(ip, XFS_IOLOCK_SHARED); + + return 0; +} + +STATIC int xfs_sync_inode_data( struct xfs_inode *ip, struct xfs_perag *pag, @@ -359,14 +372,14 @@ xfs_quiesce_data( { int error, error2 = 0; - /* push non-blocking */ - xfs_sync_data(mp, 0); - xfs_qm_sync(mp, SYNC_TRYLOCK); - - /* push and block till complete */ - xfs_sync_data(mp, SYNC_WAIT); xfs_qm_sync(mp, SYNC_WAIT); + error = xfs_inode_ag_iterator(mp, xfs_wait_ioend_cb, 0); + if (error) + return XFS_ERROR(error); + + xfs_log_force(mp, XFS_LOG_SYNC); + /* write superblock and hoover up shutdown errors */ error = xfs_sync_fsdata(mp); -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html