Date: Fri, 10 Apr 2020 01:24:16 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359766 - head/sys/ufs/ffs Message-ID: <202004100124.03A1OG1T049787@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004100124.03A1OG1T049787>