From 65a73d5f0bc196813f74ef8c29064264eb2b1b1b Mon Sep 17 00:00:00 2001 From: avg Date: Wed, 15 Sep 2010 10:31:27 +0000 Subject: tmpfs, zfs + sendfile: mark page bits as valid after populating it with data Otherwise, adding insult to injury, in addition to double-caching of data we would always copy the data into a vnode's vm object page from backend. This is specific to sendfile case only (VOP_READ with UIO_NOCOPY). PR: kern/141305 Reported by: Wiktor Niesiobedzki Reviewed by: alc Tested by: tools/regression/sockets/sendfile MFC after: 2 weeks --- sys/fs/tmpfs/tmpfs_vnops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/fs') diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index d3f1ff5..f1768320 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -562,6 +562,8 @@ lookupvpg: sf_buf_free(sf); sched_unpin(); VM_OBJECT_LOCK(vobj); + if (error == 0) + vm_page_set_valid(m, offset, tlen); vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); return (error); -- cgit v1.1