Date: Tue, 17 Sep 2019 15:53:40 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352450 - head/sys/kern Message-ID: <201909171553.x8HFre1x054197@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909171553.x8HFre1x054197>