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 <bsd@vink.pl> Reviewed by: alc Tested by: tools/regression/sockets/sendfile MFC after: 2 weeks
This commit is contained in:
parent
8518caf2a7
commit
21bd3e2576
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212650
@ -498,6 +498,8 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio)
|
|||||||
sched_unpin();
|
sched_unpin();
|
||||||
}
|
}
|
||||||
VM_OBJECT_LOCK(obj);
|
VM_OBJECT_LOCK(obj);
|
||||||
|
if (error == 0)
|
||||||
|
vm_page_set_valid(m, off, bytes);
|
||||||
vm_page_wakeup(m);
|
vm_page_wakeup(m);
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
uio->uio_resid -= bytes;
|
uio->uio_resid -= bytes;
|
||||||
|
@ -562,6 +562,8 @@ tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio
|
|||||||
sf_buf_free(sf);
|
sf_buf_free(sf);
|
||||||
sched_unpin();
|
sched_unpin();
|
||||||
VM_OBJECT_LOCK(vobj);
|
VM_OBJECT_LOCK(vobj);
|
||||||
|
if (error == 0)
|
||||||
|
vm_page_set_valid(m, offset, tlen);
|
||||||
vm_page_wakeup(m);
|
vm_page_wakeup(m);
|
||||||
VM_OBJECT_UNLOCK(vobj);
|
VM_OBJECT_UNLOCK(vobj);
|
||||||
return (error);
|
return (error);
|
||||||
|
Loading…
Reference in New Issue
Block a user