Date: Sun, 17 Dec 1995 23:40:03 -0800 (PST) From: David Greenman <davidg@Root.COM> To: freebsd-bugs Subject: Re: kern/901: busy pages get free'd by vm_page_free Message-ID: <199512180740.XAA08994@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/901; it has been noted by GNATS. From: David Greenman <davidg@Root.COM> To: aagero@aage.aage.priv.no Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/901: busy pages get free'd by vm_page_free Date: Sun, 17 Dec 1995 23:37:12 -0800 >>Description: > >vm_page_free() in vfs_bio.c has an incorrent index of the free(?) pages. When >vm_hold_free_pages() calls vm_page_free() it points to the wrong page due to >the index being a signed datatype. > >>How-To-Repeat: > >Do a lot of activity, in order to get the paging moving. Usually ls -lR / has >been sufficient. > >>Fix: > >Apply the included patch. > >--- kern/vfs_bio.c Sun Dec 17 02:51:17 1995 >+++ kern/vfs_bio.c~ Sun Dec 17 02:51:04 1995 >@@ -1634,7 +1634,7 @@ > vm_offset_t to = round_page(toa); > > for (pg = from; pg < to; pg += PAGE_SIZE) { >- int index = ((caddr_t) pg - bp->b_data) >> PAGE_SHIFT; >+ unsigned int index = ((caddr_t) pg - bp->b_data) >> PAGE_SHIFT; > p = bp->b_pages[index]; > bp->b_pages[index] = 0; > pmap_kremove(pg); I must be really missing something. The index that is calculated should always be between 0 and 1 (or some small number). I don't understand why making index unsigned would make any difference since it should always be positive. If it's ever negative, well then that's quite another problem. -DG
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512180740.XAA08994>