svn commit: r281121 - head/sys/fs/msdosfs

Konstantin Belousov kib at FreeBSD.org
Sun Apr 5 21:10:39 UTC 2015


Author: kib
Date: Sun Apr  5 21:10:38 2015
New Revision: 281121
URL: https://svnweb.freebsd.org/changeset/base/281121

Log:
  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 at incore.de
  MFC after:	1 week

Modified:
  head/sys/fs/msdosfs/msdosfs_vfsops.c

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vfsops.c	Sun Apr  5 21:08:04 2015	(r281120)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.c	Sun Apr  5 21:10:38 2015	(r281121)
@@ -796,17 +796,17 @@ msdosfs_unmount(struct mount *mp, int mn
 	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) {


More information about the svn-src-all mailing list