swap_pager: Unbusy readahead pages after an I/O error

The swap pager itself allocates readahead pages, so should take care to
unbusy them after a read error, just as it does in the non-error case.

PR:		277538
Reviewed by:	olce, dougm, alc, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44646

(cherry picked from commit 4696650782)
This commit is contained in:
Mark Johnston 2024-04-08 09:02:48 -04:00
parent 14148b5c5c
commit 5128c8948b

View file

@ -1686,6 +1686,9 @@ swp_pager_async_iodone(struct buf *bp)
* getpages so don't play cute tricks here.
*/
vm_page_invalid(m);
if (i < bp->b_pgbefore ||
i >= bp->b_npages - bp->b_pgafter)
vm_page_free_invalid(m);
} else {
/*
* If a write error occurs, reactivate page