From 87df4f8f189a4188a60a6f19dcaec1f002dc41ae Mon Sep 17 00:00:00 2001 From: Semen Ustimenko Date: Sun, 11 Aug 2002 20:33:11 +0000 Subject: [PATCH] Fix sendfile(), who was calling vn_rdwr() without aresid parameter and thus hiting EIO at the end of file. This is believed to be a feature (not a bug) of vn_rdwr(), so we turn it off by supplying aresid param. Reviewed by: rwatson, dg --- sys/kern/uipc_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 35f89f22e50e..123aef6147db 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1838,7 +1838,7 @@ retry_lookup: */ if (!pg->valid || !vm_page_is_valid(pg, pgoff, xfsize)) { - int bsize; + int bsize, resid; /* * Ensure that our page is still around when the I/O @@ -1855,7 +1855,7 @@ retry_lookup: error = vn_rdwr(UIO_READ, vp, NULL, MAXBSIZE, trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((MAXBSIZE / bsize) << 16), - td->td_ucred, NULL, td); + td->td_ucred, &resid, td); VOP_UNLOCK(vp, 0, td); vm_page_lock_queues(); vm_page_flag_clear(pg, PG_ZERO);