svn commit: r292382 - projects/sendfile/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Wed Dec 16 22:59:33 UTC 2015


Author: glebius
Date: Wed Dec 16 22:59:32 2015
New Revision: 292382
URL: https://svnweb.freebsd.org/changeset/base/292382

Log:
  Fix a bug when we request I/O into a valid page.

Modified:
  projects/sendfile/sys/kern/uipc_syscalls.c

Modified: projects/sendfile/sys/kern/uipc_syscalls.c
==============================================================================
--- projects/sendfile/sys/kern/uipc_syscalls.c	Wed Dec 16 22:48:32 2015	(r292381)
+++ projects/sendfile/sys/kern/uipc_syscalls.c	Wed Dec 16 22:59:32 2015	(r292382)
@@ -2215,6 +2215,8 @@ sendfile_swapin(vm_object_t obj, struct 
 		 * pages for it.  Since readahead is optional, we prefer
 		 * failure over sleep and thus say VM_ALLOC_NOWAIT.
 		 */
+		if (j < npages)
+			a = min(a, j - i - 1);
 		count = min(a + 1, npages + rhpages - i);
 		for (j = npages; j < i + count; j++) {
 			pa[j] = vm_page_grab(obj, OFF_TO_IDX(vmoff(j, off)),


More information about the svn-src-projects mailing list