diff options
author | kib <kib@FreeBSD.org> | 2015-04-05 21:10:38 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-04-05 21:10:38 +0000 |
commit | 1440f3812acc64522ec87433867df361e3e51439 (patch) | |
tree | 3699ad3f34978df62b7cf5a8392f0f28bd609771 /sys/fs | |
parent | 95e51995786685d7cceb893fae4a6c359ce7aee9 (diff) | |
download | FreeBSD-src-1440f3812acc64522ec87433867df361e3e51439.zip FreeBSD-src-1440f3812acc64522ec87433867df361e3e51439.tar.gz |
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
Diffstat (limited to 'sys/fs')
-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 d14cdef..1165934 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) { |