From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH 2/5] [PATCH 5/5] xfs: fix xfs_quiesce_data Date: Tue, 06 Oct 2009 16:29:27 -0400 Message-ID: <20091006203642.877846388@bombadil.infradead.org> References: <20091006202925.459164320@bombadil.infradead.org> Cc: linux-fsdevel@vger.kernel.org, Dave Chinner To: aelder@sgi.com, xfs@oss.sgi.com, akpm@linux-foundation.org, sfr@canb.auug.org.au Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:45472 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933249AbZJFUhZ (ORCPT ); Tue, 6 Oct 2009 16:37:25 -0400 Content-Disposition: inline; filename=xfs-fix-xfs_quiesce_data Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Dave Chinner 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 Signed-off-by: Christoph Hellwig 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)