fix overwrite case yamt-pagecache
authoryamt <yamt@NetBSD.org>
Sat, 14 Jan 2012 04:44:45 +0000
branchyamt-pagecache
changeset 280346 cbf877041e98
parent 280345 e6061fba10e1
child 280347 b6e0c9b611b2
fix overwrite case
sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c	Sat Jan 14 04:36:39 2012 +0000
+++ b/sys/miscfs/genfs/genfs_io.c	Sat Jan 14 04:44:45 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.53.2.6 2011/12/20 13:46:17 yamt Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.53.2.7 2012/01/14 04:44:45 yamt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.53.2.6 2011/12/20 13:46:17 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.53.2.7 2012/01/14 04:44:45 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -370,12 +370,10 @@
 			struct vm_page *pg = pgs[ridx + i];
 
 			/*
-			 * we should not see PG_HOLE pages here as it's a
-			 * caller's responsibility to allocate blocks
+			 * it's caller's responsibility to allocate blocks
 			 * beforehand for the overwrite case.
 			 */
-			KASSERT((pg->flags & PG_HOLE) == 0);
-			pg->flags &= ~PG_RDONLY;
+			pg->flags &= ~(PG_RDONLY|PG_HOLE);
 			/*
 			 * mark the page dirty.
 			 * otherwise another thread can do putpages and pull