Author: kib
Date: Sun Apr 12 05:10:48 2020
New Revision: 359818
URL: https://svnweb.freebsd.org/changeset/base/359818

Log:
  sendfile_iodone: correct calculation of the page index for relookup.
  
  This is yet another bug in r359473.
  
  Reported and tested by:       delphij
  Sponsored by: The FreeBSD Foundation
  MFC after:    2 weeks

Modified:
  head/sys/kern/kern_sendfile.c

Modified: head/sys/kern/kern_sendfile.c
==============================================================================
--- head/sys/kern/kern_sendfile.c       Sun Apr 12 03:10:29 2020        
(r359817)
+++ head/sys/kern/kern_sendfile.c       Sun Apr 12 05:10:48 2020        
(r359818)
@@ -298,7 +298,7 @@ sendfile_iodone(void *arg, vm_page_t *pa, int count, i
                for (i = 0; i < count; i++) {
                        if (pa[i] == bogus_page) {
                                pa[i] = vm_page_relookup(sfio->obj,
-                                   sfio->pindex0 + i + (sfio->pa - pa));
+                                   sfio->pindex0 + i + (pa - sfio->pa));
                                KASSERT(pa[i] != NULL,
                                    ("%s: page %p[%d] disappeared",
                                    __func__, pa, i));
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to