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
This commit is contained in:
Konstantin Belousov 2020-04-12 05:10:48 +00:00
parent 31de6cad17
commit d25f1b21c9

View File

@ -298,7 +298,7 @@ sendfile_iodone(void *arg, vm_page_t *pa, int count, int error)
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));