summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-10-20 17:44:40 +0000
committeralc <alc@FreeBSD.org>2004-10-20 17:44:40 +0000
commitd66bfa760a44a976ce18a67de69e4862541c51db (patch)
tree3dc99f0570edfc471e1aa672bb5b132e18362a23 /sys/kern/uipc_syscalls.c
parent6efc621989969f3c68fb17034229e45c303b072e (diff)
downloadFreeBSD-src-d66bfa760a44a976ce18a67de69e4862541c51db.zip
FreeBSD-src-d66bfa760a44a976ce18a67de69e4862541c51db.tar.gz
Modify the vm object locking in do_sendfile() so that the containing object
is locked when vm_page_io_finish() is called on a page. This is to satisfy a new, post-RELENG_5 assertion in vm_page_io_finish(). (I am in the process of transitioning the responsibility for synchronizing access to various fields/flags on the page from the global page queues lock to the per-object lock.) Tripped over by: obrien@
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 809bdfa..49b6511 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1890,10 +1890,11 @@ retry_lookup:
IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT),
td->td_ucred, NOCRED, &resid, td);
VOP_UNLOCK(vp, 0, td);
- if (error)
- VM_OBJECT_LOCK(obj);
+ VM_OBJECT_LOCK(obj);
vm_page_lock_queues();
vm_page_io_finish(pg);
+ if (!error)
+ VM_OBJECT_UNLOCK(obj);
mbstat.sf_iocnt++;
}
OpenPOWER on IntegriCloud