1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

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@
This commit is contained in:
Alan Cox 2004-10-20 17:44:40 +00:00
parent 6e1b2264bd
commit 0f777d7d9b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136731

View File

@ -1890,10 +1890,11 @@ do_sendfile(struct thread *td, struct sendfile_args *uap, int compat)
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++;
}