summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-10-08 21:56:08 +1100
committerBen Myers <bpm@sgi.com>2012-10-17 13:39:14 -0500
commitc75921a72a7c4bb73a5e09a697a672722e5543f1 (patch)
treeed46f37241cdc860ffc691f6d71159333c434a83 /fs/xfs/xfs_super.c
parentc7eea6f7adca4501d2c2db7f0f7c9dc88efac95e (diff)
downloadlinux-c75921a72a7c4bb73a5e09a697a672722e5543f1.tar.bz2
xfs: xfs_quiesce_attr() should quiesce the log like unmount
xfs_quiesce_attr() is supposed to leave the log empty with an unmount record written. Right now it does not wait for the AIL to be emptied before writing the unmount record, not does it wait for metadata IO completion, either. Fix it to use the same method and code as xfs_log_unmount(). Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 3bafe66227fb..fdedf2cabae3 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1153,15 +1153,11 @@ xfs_restore_resvblks(struct xfs_mount *mp)
*
* This ensures that the metadata is written to their location on disk rather
* than just existing in transactions in the log. This means after a quiesce
- * there is no log replay required to write the inodes to disk (this is the main
- * difference between a sync and a quiesce).
+ * there is no log replay required to write the inodes to disk - this is the
+ * primary difference between a sync and a quiesce.
*
- * This shoul deffectively mimic the code in xfs_unmountfs() and
- * xfs_log_umount() but without tearing down any structures.
- * XXX: bug fixes needed!
- *
- * Note: this stops background log work - the callers must ensure it is started
- * again when appropriate.
+ * Note: xfs_log_quiesce() stops background log work - the callers must ensure
+ * it is started again when appropriate.
*/
void
xfs_quiesce_attr(
@@ -1180,39 +1176,18 @@ xfs_quiesce_attr(
xfs_reclaim_inodes(mp, 0);
xfs_reclaim_inodes(mp, SYNC_WAIT);
- /* flush all pending changes from the AIL */
- xfs_ail_push_all_sync(mp->m_ail);
-
- /* stop background log work */
- cancel_delayed_work_sync(&mp->m_log->l_work);
-
- /*
- * Just warn here till VFS can correctly support
- * read-only remount without racing.
- */
- WARN_ON(atomic_read(&mp->m_active_trans) != 0);
-
/* Push the superblock and write an unmount record */
error = xfs_log_sbcount(mp);
if (error)
xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. "
"Frozen image may not be consistent.");
- xfs_log_unmount_write(mp);
-
/*
- * At this point we might have modified the superblock again and thus
- * added an item to the AIL, thus flush it again.
+ * Just warn here till VFS can correctly support
+ * read-only remount without racing.
*/
- xfs_ail_push_all_sync(mp->m_ail);
+ WARN_ON(atomic_read(&mp->m_active_trans) != 0);
- /*
- * The superblock buffer is uncached and xfsaild_push() will lock and
- * set the XBF_ASYNC flag on the buffer. We cannot do xfs_buf_iowait()
- * here but a lock on the superblock buffer will block until iodone()
- * has completed.
- */
- xfs_buf_lock(mp->m_sb_bp);
- xfs_buf_unlock(mp->m_sb_bp);
+ xfs_log_quiesce(mp);
}
STATIC int