[XFS] Fix a barrier related forced shutdown on mounts with quota enabled.
authorNathan Scott <nathans@sgi.com>
Fri, 28 Jul 2006 07:05:13 +0000 (17:05 +1000)
committerNathan Scott <nathans@sgi.com>
Fri, 28 Jul 2006 07:05:13 +0000 (17:05 +1000)
SGI-PV: 912426
SGI-Modid: xfs-linux-melb:xfs-kern:26622a

Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/xfs_vfsops.c

index 9bdef9d..4754f34 100644 (file)
@@ -314,6 +314,13 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp)
                return;
        }
 
+       if (xfs_readonly_buftarg(mp->m_ddev_targp)) {
+               xfs_fs_cmn_err(CE_NOTE, mp,
+                 "Disabling barriers, underlying device is readonly");
+               mp->m_flags &= ~XFS_MOUNT_BARRIER;
+               return;
+       }
+
        error = xfs_barrier_test(mp);
        if (error) {
                xfs_fs_cmn_err(CE_NOTE, mp,
index 6c96391..b427d22 100644 (file)
@@ -515,7 +515,7 @@ xfs_mount(
        if (error)
                goto error2;
 
-       if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY))
+       if (mp->m_flags & XFS_MOUNT_BARRIER)
                xfs_mountfs_check_barriers(mp);
 
        error = XFS_IOINIT(vfsp, args, flags);