summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-05-05 23:17:13 +0000
committerjeff <jeff@FreeBSD.org>2002-05-05 23:17:13 +0000
commit4323e678dac53d14c9b7acd6425cd62e09084a7d (patch)
treeb915f8a164ceef82722c2e8d7ef4bbacb13bb1f4 /sys/kern/vfs_extattr.c
parentc5483b31299fa695c49c9430a252b1989c74121a (diff)
downloadFreeBSD-src-4323e678dac53d14c9b7acd6425cd62e09084a7d.zip
FreeBSD-src-4323e678dac53d14c9b7acd6425cd62e09084a7d.tar.gz
Move a KASSERT() in open() prior to unlocking the vnode. It's not safe to
call VOP_GETVOBJECT without a lock.
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index f89e8b9..1db5510 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -1765,6 +1765,10 @@ open(td, uap)
return 0;
}
+ /* assert that vn_open created a backing object if one is needed */
+ KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
+ ("open: vmio vnode has no backing object after vn_open"));
+
fp->f_data = (caddr_t)vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
@@ -1800,9 +1804,6 @@ open(td, uap)
if (error)
goto bad;
}
- /* assert that vn_open created a backing object if one is needed */
- KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
- ("open: vmio vnode has no backing object after vn_open"));
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.
OpenPOWER on IntegriCloud