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
This commit is contained in:
parent
4e17493163
commit
87df4f8f18
@ -1838,7 +1838,7 @@ do_sendfile(struct thread *td, struct sendfile_args *uap, int compat)
|
||||
*/
|
||||
|
||||
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 @@ do_sendfile(struct thread *td, struct sendfile_args *uap, int compat)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user