svn commit: r352450 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Tue Sep 17 15:53:41 UTC 2019


Author: mjg
Date: Tue Sep 17 15:53:40 2019
New Revision: 352450
URL: https://svnweb.freebsd.org/changeset/base/352450

Log:
  vfs: apply r352437 to the fast path as well
  
  This one is very hard to run into. If the filesystem is being unmounted or
  the mount point is freed the vfs_op_thread_enter will fail. For it to
  succeed the mount point itself would have to be reallocated in the time
  window between the initial read and the attempt to enter.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Tue Sep 17 14:15:48 2019	(r352449)
+++ head/sys/kern/vfs_default.c	Tue Sep 17 15:53:40 2019	(r352450)
@@ -606,11 +606,13 @@ vop_stdgetwritemount(ap)
 		return (0);
 	}
 	if (vfs_op_thread_enter(mp)) {
-		if (mp == vp->v_mount)
+		if (mp == vp->v_mount) {
 			vfs_mp_count_add_pcpu(mp, ref, 1);
-		else
+			vfs_op_thread_exit(mp);
+		} else {
+			vfs_op_thread_exit(mp);
 			mp = NULL;
-		vfs_op_thread_exit(mp);
+		}
 	} else {
 		MNT_ILOCK(mp);
 		if (mp == vp->v_mount) {


More information about the svn-src-head mailing list