diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2015-04-05 21:10:38 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2015-04-05 21:10:38 +0000 |
commit | 2359e2dcc3a2fda427feea98ea45899101fc9da1 (patch) | |
tree | 3699ad3f34978df62b7cf5a8392f0f28bd609771 /sys/fs/msdosfs/msdosfs_vfsops.c | |
parent | 420d65d9e467d41c2951dcf2c0495282670c85d1 (diff) | |
download | src-2359e2dcc3a2fda427feea98ea45899101fc9da1.tar.gz src-2359e2dcc3a2fda427feea98ea45899101fc9da1.zip |
Do not call msdosfs_sync() on the read-only msdosfs mounts. In fact,
it should be a nop for ro.
PR: 199152
Reviewed by: bde (PR version of the patch)
Submitted by: longwitz@incore.de
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=281121
Diffstat (limited to 'sys/fs/msdosfs/msdosfs_vfsops.c')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index d14cdef51a75..11659349357b 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -796,17 +796,17 @@ msdosfs_unmount(struct mount *mp, int mntflags) struct msdosfsmount *pmp; int error, flags; - flags = 0; - error = msdosfs_sync(mp, MNT_WAIT); - if ((mntflags & MNT_FORCE) != 0) { + error = flags = 0; + pmp = VFSTOMSDOSFS(mp); + if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) + error = msdosfs_sync(mp, MNT_WAIT); + if ((mntflags & MNT_FORCE) != 0) flags |= FORCECLOSE; - } else if (error != 0) { + else if (error != 0) return (error); - } error = vflush(mp, 0, flags, curthread); if (error != 0 && error != ENXIO) return (error); - pmp = VFSTOMSDOSFS(mp); if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); if (error && error != ENXIO) { |