From: mjg Date: Tue, 17 Sep 2019 15:53:40 +0000 (+0000) Subject: vfs: apply r352437 to the fast path as well X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b6dddc83dd6054edeb98f7730d784719c4584d67;p=freebsd.git 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 --- diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 2fd95fbc8b4..8aee8abfbe7 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -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) {