Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 223062)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy)
@@ -346,6 +346,9 @@ page_unlock(vm_page_t pp)
{
vm_page_wakeup(pp);
+ vm_page_lock_queues();
+ vm_page_activate(pp);
+ vm_page_unlock_queues();
}
static caddr_t
@@ -464,7 +467,7 @@ again:
if (error == 0)
uiomove_fromphys(&m, off, bytes, uio);
VM_OBJECT_LOCK(obj);
- vm_page_wakeup(m);
+ page_unlock(m);
} else if (uio->uio_segflg == UIO_NOCOPY) {
/*
* The code below is here to make sendfile(2) work
@@ -503,10 +506,16 @@ again:
zfs_unmap_page(sf);
}
VM_OBJECT_LOCK(obj);
- if (error == 0)
- m->valid = VM_PAGE_BITS_ALL;
vm_page_io_finish(m);
+ vm_page_lock_queues();
if (error == 0) {
+ m->valid = VM_PAGE_BITS_ALL;
+ vm_page_activate(m);
+ } else
+ vm_page_free(m);
+ vm_page_unlock_queues();
+
+ if (error == 0) {
uio->uio_resid -= bytes;
uio->uio_offset += bytes;
}