Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jan 1996 14:11:27 -0800 (PST)
From:      Poul-Henning Kamp <phk>
To:        aagero@aage.aage.priv.no, phk, freebsd-bugs
Subject:   Re: kern/901
Message-ID:  <199601062211.OAA22075@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
Synopsis: vm_page_free frees wrong pages in vfs_bio.c

State-Changed-From-To: open-feedback
State-Changed-By: phk
State-Changed-When: Sat Jan 6 13:54:21 PST 1996
State-Changed-Why: 

It actually looks like you're right, if 
	((caddr_t) pg - bp->b_data) 
is bigger than 0x7f000000
then trouble abounds.

Could you try this patch instead ?

Index: vfs_bio.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v
retrieving revision 1.81
diff -u -r1.81 vfs_bio.c
--- vfs_bio.c	1996/01/05 20:12:33	1.81
+++ vfs_bio.c	1996/01/06 21:58:17
@@ -1637,9 +1637,9 @@
 	vm_page_t p;
 	vm_offset_t from = round_page(froma);
 	vm_offset_t to = round_page(toa);
+	unsigned int index = ((caddr_t) from - bp->b_data) >> PAGE_SHIFT;
 
-	for (pg = from; pg < to; pg += PAGE_SIZE) {
-		int index = ((caddr_t) pg - bp->b_data) >> PAGE_SHIFT;
+	for (pg = from; pg < to; pg += PAGE_SIZE, index++) {
 		p = bp->b_pages[index];
 		bp->b_pages[index] = 0;
 		pmap_kremove(pg);


Poul-Henning Kamp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601062211.OAA22075>