summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2003-06-19 03:55:01 +0000
committertruckman <truckman@FreeBSD.org>2003-06-19 03:55:01 +0000
commitb30ab680435de281a79997c003bace36f138771b (patch)
treeb118943b530f98aca5a18d8c2a4b59abf9b9e5a0 /sys/kern/uipc_syscalls.c
parent12db87194bbf4d8293c519272585ef493706f32e (diff)
downloadFreeBSD-src-b30ab680435de281a79997c003bace36f138771b.zip
FreeBSD-src-b30ab680435de281a79997c003bace36f138771b.tar.gz
VOP_GETVOBJECT() wants to be called with the vnode lock held.
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 98be6d3..d6b6947 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1775,10 +1775,13 @@ do_sendfile(struct thread *td, struct sendfile_args *uap, int compat)
*/
if ((error = fgetvp_read(td, uap->fd, &vp)) != 0)
goto done;
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (vp->v_type != VREG || VOP_GETVOBJECT(vp, &obj) != 0) {
error = EINVAL;
+ VOP_UNLOCK(vp, 0, td);
goto done;
}
+ VOP_UNLOCK(vp, 0, td);
if ((error = fgetsock(td, uap->s, &so, NULL)) != 0)
goto done;
if (so->so_type != SOCK_STREAM) {
OpenPOWER on IntegriCloud