aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r--fs/xfs/xfs_vfsops.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index f1a904e23ade..8238c7517822 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -321,8 +321,8 @@ xfs_start_flags(
321 321
322 if (ap->flags & XFSMNT_NOUUID) 322 if (ap->flags & XFSMNT_NOUUID)
323 mp->m_flags |= XFS_MOUNT_NOUUID; 323 mp->m_flags |= XFS_MOUNT_NOUUID;
324 if (ap->flags & XFSMNT_NOLOGFLUSH) 324 if (ap->flags & XFSMNT_BARRIER)
325 mp->m_flags |= XFS_MOUNT_NOLOGFLUSH; 325 mp->m_flags |= XFS_MOUNT_BARRIER;
326 326
327 return 0; 327 return 0;
328} 328}
@@ -512,8 +512,14 @@ xfs_mount(
512 goto error2; 512 goto error2;
513 513
514 error = XFS_IOINIT(vfsp, args, flags); 514 error = XFS_IOINIT(vfsp, args, flags);
515 if (!error) 515 if (error)
516 return 0; 516 goto error2;
517
518 if ((args->flags & XFSMNT_BARRIER) &&
519 !(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY))
520 xfs_mountfs_check_barriers(mp);
521 return 0;
522
517error2: 523error2:
518 if (mp->m_sb_bp) 524 if (mp->m_sb_bp)
519 xfs_freesb(mp); 525 xfs_freesb(mp);
@@ -656,19 +662,24 @@ xfs_mntupdate(
656 else 662 else
657 mp->m_flags &= ~XFS_MOUNT_NOATIME; 663 mp->m_flags &= ~XFS_MOUNT_NOATIME;
658 664
659 if (!(vfsp->vfs_flag & VFS_RDONLY)) { 665 if ((vfsp->vfs_flag & VFS_RDONLY) &&
660 VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); 666 !(*flags & MS_RDONLY)) {
667 vfsp->vfs_flag &= ~VFS_RDONLY;
668
669 if (args->flags & XFSMNT_BARRIER)
670 xfs_mountfs_check_barriers(mp);
661 } 671 }
662 672
663 if (*flags & MS_RDONLY) { 673 if (!(vfsp->vfs_flag & VFS_RDONLY) &&
674 (*flags & MS_RDONLY)) {
675 VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error);
676
664 xfs_quiesce_fs(mp); 677 xfs_quiesce_fs(mp);
665 678
666 /* Ok now write out an unmount record */ 679 /* Ok now write out an unmount record */
667 xfs_log_unmount_write(mp); 680 xfs_log_unmount_write(mp);
668 xfs_unmountfs_writesb(mp); 681 xfs_unmountfs_writesb(mp);
669 vfsp->vfs_flag |= VFS_RDONLY; 682 vfsp->vfs_flag |= VFS_RDONLY;
670 } else {
671 vfsp->vfs_flag &= ~VFS_RDONLY;
672 } 683 }
673 684
674 return 0; 685 return 0;
@@ -1628,7 +1639,8 @@ xfs_vget(
1628#define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ 1639#define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */
1629#define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ 1640#define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */
1630#define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ 1641#define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */
1631#define MNTOPT_NOLOGFLUSH "nologflush" /* don't hard flush on log writes */ 1642#define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and
1643 unwritten extent conversion */
1632#define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */ 1644#define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */
1633#define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ 1645#define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */
1634#define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ 1646#define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */
@@ -1791,8 +1803,8 @@ xfs_parseargs(
1791#endif 1803#endif
1792 } else if (!strcmp(this_char, MNTOPT_NOUUID)) { 1804 } else if (!strcmp(this_char, MNTOPT_NOUUID)) {
1793 args->flags |= XFSMNT_NOUUID; 1805 args->flags |= XFSMNT_NOUUID;
1794 } else if (!strcmp(this_char, MNTOPT_NOLOGFLUSH)) { 1806 } else if (!strcmp(this_char, MNTOPT_BARRIER)) {
1795 args->flags |= XFSMNT_NOLOGFLUSH; 1807 args->flags |= XFSMNT_BARRIER;
1796 } else if (!strcmp(this_char, MNTOPT_IKEEP)) { 1808 } else if (!strcmp(this_char, MNTOPT_IKEEP)) {
1797 args->flags &= ~XFSMNT_IDELETE; 1809 args->flags &= ~XFSMNT_IDELETE;
1798 } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { 1810 } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) {
@@ -1866,7 +1878,7 @@ xfs_showargs(
1866 { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, 1878 { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID },
1867 { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, 1879 { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY },
1868 { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, 1880 { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC },
1869 { XFS_MOUNT_NOLOGFLUSH, "," MNTOPT_NOLOGFLUSH }, 1881 { XFS_MOUNT_BARRIER, "," MNTOPT_BARRIER },
1870 { XFS_MOUNT_IDELETE, "," MNTOPT_NOIKEEP }, 1882 { XFS_MOUNT_IDELETE, "," MNTOPT_NOIKEEP },
1871 { 0, NULL } 1883 { 0, NULL }
1872 }; 1884 };