diff options
author | Nathan Scott <nathans@sgi.com> | 2006-05-08 19:51:28 +1000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-05-08 19:51:28 +1000 |
commit | d08d389d5aef0509edba7ee42cd6c6a3998fee22 (patch) | |
tree | 829f45f629852b421f74db2ee5db0ca1a706ed4f /fs | |
parent | 9d21f09ca03d1142f1988001f228d02581d8986c (diff) | |
download | lwn-d08d389d5aef0509edba7ee42cd6c6a3998fee22.tar.gz lwn-d08d389d5aef0509edba7ee42cd6c6a3998fee22.zip |
[XFS] Fix a possible forced shutdown due to mishandling write barriers
with remount,ro.
SGI-PV: 951944
SGI-Modid: xfs-linux-melb:xfs-kern:25742a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index f0e09ca14139..36ea1b2094f2 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -669,31 +669,22 @@ xfs_mntupdate( xfs_mount_t *mp = XFS_BHVTOM(bdp); int error; - if (args->flags & XFSMNT_BARRIER) - mp->m_flags |= XFS_MOUNT_BARRIER; - else - mp->m_flags &= ~XFS_MOUNT_BARRIER; - - if ((vfsp->vfs_flag & VFS_RDONLY) && - !(*flags & MS_RDONLY)) { - vfsp->vfs_flag &= ~VFS_RDONLY; - - if (args->flags & XFSMNT_BARRIER) + if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ + if (vfsp->vfs_flag & VFS_RDONLY) + vfsp->vfs_flag &= ~VFS_RDONLY; + if (args->flags & XFSMNT_BARRIER) { + mp->m_flags |= XFS_MOUNT_BARRIER; xfs_mountfs_check_barriers(mp); - } - - if (!(vfsp->vfs_flag & VFS_RDONLY) && - (*flags & MS_RDONLY)) { + } else { + mp->m_flags &= ~XFS_MOUNT_BARRIER; + } + } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */ VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); - xfs_quiesce_fs(mp); - - /* Ok now write out an unmount record */ xfs_log_unmount_write(mp); xfs_unmountfs_writesb(mp); vfsp->vfs_flag |= VFS_RDONLY; } - return 0; } |