xfs
[Top] [All Lists]

[PATCH 4/4] [PATCH 5/5] xfs: fix xfs_quiesce_data

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/4] [PATCH 5/5] xfs: fix xfs_quiesce_data
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 16 Sep 2009 09:18:22 -0400
Cc: Dave Chinner <david@xxxxxxxxxxxxx>
References: <20090916131818.939008605@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.47-1
From: Dave Chinner <david@xxxxxxxxxxxxx>

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 filestreams associations
after the syncing.


Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: linux-2.6/fs/xfs/linux-2.6/xfs_sync.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_sync.c  2009-08-27 20:06:39.889355294 
-0300
+++ linux-2.6/fs/xfs/linux-2.6/xfs_sync.c       2009-08-27 20:08:01.169357854 
-0300
@@ -426,14 +426,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)

<Prev in Thread] Current Thread [Next in Thread>