svn commit: r359766 - head/sys/ufs/ffs

Konstantin Belousov kib at FreeBSD.org
Fri Apr 10 01:24:17 UTC 2020


Author: kib
Date: Fri Apr 10 01:24:16 2020
New Revision: 359766
URL: https://svnweb.freebsd.org/changeset/base/359766

Log:
  ufs: apply suspension for non-forced rw unmounts.
  
  Forced rw unmounts and remounts from rw to ro already suspend
  filesystem, which closes races with writers instantiating new vnodes
  while unmount flushes the queue.  Original intent of not including
  non-forced unmounts into this regime was to allow such unmounts to
  fail if writer was active, but this did not worked well.
  
  Similar change, but causing all unmount, even involving only ro
  filesystem, were proposed in D24088, but I believe that suspending ro
  is undesirable, and definitely spends CPU time.
  
  Reported by:	markj
  Discussed with:	chs, mckusick
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Fri Apr 10 01:23:06 2020	(r359765)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Fri Apr 10 01:24:16 2020	(r359766)
@@ -1247,11 +1247,9 @@ ffs_unmount(mp, mntflags)
 	flags = 0;
 	td = curthread;
 	fs = ump->um_fs;
-	susp = 0;
-	if (mntflags & MNT_FORCE) {
+	if (mntflags & MNT_FORCE)
 		flags |= FORCECLOSE;
-		susp = fs->fs_ronly == 0;
-	}
+	susp = fs->fs_ronly == 0;
 #ifdef UFS_EXTATTR
 	if ((error = ufs_extattr_stop(mp, td))) {
 		if (error != EOPNOTSUPP)


More information about the svn-src-all mailing list