summaryrefslogtreecommitdiff
path: root/sys/msdosfs/msdosfs_vfsops.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2014-05-27 21:52:20 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2014-05-27 21:52:20 +0000
commitcaf0d951373c4d59747d489fef643c9a1100c456 (patch)
tree7d0fc9c5b00e541c11486595b96b04afa2db6f52 /sys/msdosfs/msdosfs_vfsops.c
parent4fd96bab023a093fd12467b9b6c5258a00759e7c (diff)
Fix 'mount -ur' for msdosfs
* fix bug preventing sync after more than one rw -> ro cycle. * sync data and not only metadata ok guenther@
Diffstat (limited to 'sys/msdosfs/msdosfs_vfsops.c')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 4b82aab5941..6e5f67b116a 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.64 2014/05/09 03:54:28 tedu Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.65 2014/05/27 21:52:19 sf Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -119,10 +119,16 @@ msdosfs_mount(struct mount *mp, const char *path, void *data,
error = 0;
if (!(pmp->pm_flags & MSDOSFSMNT_RONLY) &&
(mp->mnt_flag & MNT_RDONLY)) {
+ mp->mnt_flag &= ~MNT_RDONLY;
+ VFS_SYNC(mp, MNT_WAIT, p->p_ucred, p);
+ mp->mnt_flag |= MNT_RDONLY;
+
flags = WRITECLOSE;
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
error = vflush(mp, NULLVP, flags);
+ if (!error)
+ pmp->pm_flags |= MSDOSFSMNT_RONLY;
}
if (!error && (mp->mnt_flag & MNT_RELOAD))
/* not yet implemented */