From owner-freebsd-bugs Thu Aug 13 17:40:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA18700 for freebsd-bugs-outgoing; Thu, 13 Aug 1998 17:40:07 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA18646 for ; Thu, 13 Aug 1998 17:40:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id RAA11228; Thu, 13 Aug 1998 17:40:01 -0700 (PDT) Date: Thu, 13 Aug 1998 17:40:01 -0700 (PDT) Message-Id: <199808140040.RAA11228@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Luoqi Chen Subject: Re: kern/7422: FreeBSD-current VM systems do not properly remove mapped pages on truncate in some situations. -stable does. Reply-To: Luoqi Chen Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/7422; it has been noted by GNATS. From: Luoqi Chen To: freebsd-gnats-submit@freebsd.org, dillon@backplane.com Cc: luoqi@watermarkgroup.com Subject: Re: kern/7422: FreeBSD-current VM systems do not properly remove mapped pages on truncate in some situations. -stable does. Date: Thu, 13 Aug 1998 20:35:13 -0400 This is a one-line bug in vnode_pager_setsize() function. Below is the fix, note that the higher end of page index range in function vm_object_page_remove() is not inclusive (I got rid of some auto variables and unused calculation, so the fix is more than one line). This bug should exist in -stable also, not sure why it behaved correctly (I don't have a -stable machine to test with). -lq Index: sys/vm/vnode_pager.c =================================================================== RCS file: /fun/cvs/src/sys/vm/vnode_pager.c,v retrieving revision 1.94 diff -u -r1.94 vnode_pager.c --- vnode_pager.c 1998/07/11 11:30:46 1.94 +++ vnode_pager.c 1998/08/14 00:23:36 @@ -271,12 +271,9 @@ vm_ooffset_t nsizerounded; nsizerounded = IDX_TO_OFF(OFF_TO_IDX(nsize + PAGE_MASK)); if (nsizerounded < object->un_pager.vnp.vnp_size) { - vm_pindex_t st, end; - st = OFF_TO_IDX(nsize + PAGE_MASK); - end = OFF_TO_IDX(object->un_pager.vnp.vnp_size); - vm_freeze_copyopts(object, OFF_TO_IDX(nsize), object->size); - vm_object_page_remove(object, st, end, FALSE); + vm_object_page_remove(object, OFF_TO_IDX(nsize + PAGE_MASK), + object->size, FALSE); } /* * this gets rid of garbage at the end of a page that is now To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message