xfs: fix xfs_quiesce_data
authorDave Chinner <david@fromorbit.com>
Tue, 6 Oct 2009 20:29:27 +0000 (20:29 +0000)
committerAlex Elder <aelder@sgi.com>
Thu, 8 Oct 2009 17:00:36 +0000 (12:00 -0500)
We need to do a synchronous xfs_sync_fsdata to make sure the superblock
actually is on disk when we return.

Also remove SYNC_BDFLUSH flag to xfs_sync_inodes because that particular
flag is never checked.

Move xfs_filestream_flush call later to only release inodes after they
have been written out.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/linux-2.6/xfs_sync.c

index 320be6aea4924ed6fdcf4ac1e581c0c616d04c83..7647b8db3ca38c7c845b64f4251d29418cfd7c7e 100644 (file)
@@ -419,14 +419,16 @@ xfs_quiesce_data(
        /* push non-blocking */
        xfs_sync_data(mp, 0);
        xfs_qm_sync(mp, SYNC_TRYLOCK);
-       xfs_filestream_flush(mp);
 
-       /* push and block */
+       /* push and block till complete */
        xfs_sync_data(mp, SYNC_WAIT);
        xfs_qm_sync(mp, SYNC_WAIT);
 
+       /* drop inode references pinned by filestreams */
+       xfs_filestream_flush(mp);
+
        /* write superblock and hoover up shutdown errors */
-       error = xfs_sync_fsdata(mp, 0);
+       error = xfs_sync_fsdata(mp, SYNC_WAIT);
 
        /* flush data-only devices */
        if (mp->m_rtdev_targp)