Module Name:    src
Committed By:   chs
Date:           Wed Aug 19 15:36:41 UTC 2020

Modified Files:
        src/sys/uvm: uvm_aobj.c

Log Message:
in uao_get(), if we unlock the uobj to read a page from swap,
we must clear the cached page array because it is now stale.
also add a missing call to uvm_page_array_fini() if the I/O fails.
fixes PR 55493.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/uvm/uvm_aobj.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_aobj.c
diff -u src/sys/uvm/uvm_aobj.c:1.150 src/sys/uvm/uvm_aobj.c:1.151
--- src/sys/uvm/uvm_aobj.c:1.150	Wed Aug 19 07:29:00 2020
+++ src/sys/uvm/uvm_aobj.c	Wed Aug 19 15:36:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_aobj.c,v 1.150 2020/08/19 07:29:00 simonb Exp $	*/
+/*	$NetBSD: uvm_aobj.c,v 1.151 2020/08/19 15:36:41 chs Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.150 2020/08/19 07:29:00 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.151 2020/08/19 15:36:41 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_uvmhist.h"
@@ -982,6 +982,7 @@ uao_get(struct uvm_object *uobj, voff_t 
 			 * unlock object for i/o, relock when done.
 			 */
 
+			uvm_page_array_clear(&a);
 			rw_exit(uobj->vmobjlock);
 			error = uvm_swap_get(ptmp, swslot, PGO_SYNCIO);
 			rw_enter(uobj->vmobjlock, RW_WRITER);
@@ -1015,6 +1016,7 @@ uao_get(struct uvm_object *uobj, voff_t 
 					uvm_page_unbusy(pps, lcv);
 				}
 				memset(pps, 0, maxpages * sizeof(pps[0]));
+				uvm_page_array_fini(&a);
 				return error;
 			}
 #else /* defined(VMSWAP) */

Reply via email to