summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorssouhlal <ssouhlal@FreeBSD.org>2005-08-06 01:42:04 +0000
committerssouhlal <ssouhlal@FreeBSD.org>2005-08-06 01:42:04 +0000
commit1f4d3e95efcd3e9a56a016f0c3586048991fce25 (patch)
tree2c62ba83632019391b20d5a85bd35d5065c6f434 /sys/kern/vfs_subr.c
parent4ad4f0f86c9f79eaa7ec18af7d7cfb9fc6a74501 (diff)
downloadFreeBSD-src-1f4d3e95efcd3e9a56a016f0c3586048991fce25.zip
FreeBSD-src-1f4d3e95efcd3e9a56a016f0c3586048991fce25.tar.gz
Holding a vnode doesn't prevent v_mount from disappearing (when the
vnode is inactivated), possibly leading to a NULL dereference when checking if the mount wants knotes to be activated in the VOP hooks. So, we add a new vnode flag VV_NOKNOTE that is only set in getnewvnode(), if necessary, and check it when activating knotes. Since the flags are not erased when a vnode is being held, we can safely read them. Reviewed by: kris@ MFC after: 3 days
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index fd2dd20..af6cbb0 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -896,6 +896,8 @@ getnewvnode(tag, mp, vops, vpp)
if (mp != NULL) {
insmntque(vp, mp);
bo->bo_bsize = mp->mnt_stat.f_iosize;
+ if ((mp->mnt_kern_flag & MNTK_NOKNOTE) != 0)
+ vp->v_vflag |= VV_NOKNOTE;
}
CTR2(KTR_VFS, "getnewvnode: mp %p vp %p", mp, vp);
OpenPOWER on IntegriCloud