The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4696650782e2e5cf7ae5823f1de04550c05b5b75

commit 4696650782e2e5cf7ae5823f1de04550c05b5b75
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2024-04-08 13:02:48 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2024-04-08 13:02:48 +0000

    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
---
 sys/vm/swap_pager.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index f6cfd45c3805..ee236c7f3988 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1683,6 +1683,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

Reply via email to