summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-04-12 07:05:20 +0000
committerkib <kib@FreeBSD.org>2015-04-12 07:05:20 +0000
commit1d6a22da629087698deb2685f25475a1eec0fe10 (patch)
treeb996032ec22162536a66b71e9d7172da13f0dc19 /sys/fs
parentcf6596d5abb0225665ac229fc10a559b13450d6c (diff)
downloadFreeBSD-src-1d6a22da629087698deb2685f25475a1eec0fe10.zip
FreeBSD-src-1d6a22da629087698deb2685f25475a1eec0fe10.tar.gz
MFC r281121:
Do not call msdosfs_sync() on the read-only msdosfs mounts. PR: 199152
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c12
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) {
OpenPOWER on IntegriCloud