Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-drm-fsl-dcu.git] / fs / xfs / xfs_mount.c
index b09a4a7eb640b7b85e89bde8854d5389c6757cbc..29c2f83d4147c6824f8e8b67f5a9b4968c80c92b 100644 (file)
@@ -1200,8 +1200,6 @@ xfs_mountfs(
 
        xfs_set_maxicount(mp);
 
-       mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog);
-
        error = xfs_uuid_mount(mp);
        if (error)
                goto out;
@@ -1531,6 +1529,15 @@ xfs_unmountfs(
        xfs_ail_push_all_sync(mp->m_ail);
        xfs_wait_buftarg(mp->m_ddev_targp);
 
+       /*
+        * 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_unmount_write(mp);
        xfs_log_unmount(mp);
        xfs_uuid_unmount(mp);