From owner-freebsd-hackers Wed Nov 14 21:41:45 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 6D5B737B416 for ; Wed, 14 Nov 2001 21:41:42 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id fAF5fbs18850; Wed, 14 Nov 2001 21:41:37 -0800 (PST) (envelope-from dillon) Date: Wed, 14 Nov 2001 21:41:37 -0800 (PST) From: Matthew Dillon Message-Id: <200111150541.fAF5fbs18850@apollo.backplane.com> To: "David Xu" Cc: Subject: Re: vm_map_protect() References: <005a01c16d74$9e0c88a0$ef01a8c0@davidwnt> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :In FreeBSD 4.4-stable file /sys/vm/vm_map.c, function vm_map_protect() :will leave and have an entry splitted when first pass fails. :here is the patch to avoid such issue. Hmm... don't you want to vm_map_simplify_entry() at the end instead of vm_map_clip_start()? -Matt Matthew Dillon :%diff -u vm_map.c.orig vm_map.c :--- vm_map.c.orig Thu Nov 15 08:27:19 2001 :+++ vm_map.c Thu Nov 15 09:08:47 2001 :@@ -999,13 +999,14 @@ : { : vm_map_entry_t current; : vm_map_entry_t entry; :+ int clip_start = 0; : : vm_map_lock(map); : : VM_MAP_RANGE_CHECK(map, start, end); : : if (vm_map_lookup_entry(map, start, &entry)) { :- vm_map_clip_start(map, entry, start); :+ clip_start = 1; : } else { : entry = entry->next; : } :@@ -1026,6 +1027,8 @@ : } : current = current->next; : } :+ if (clip_start) :+ vm_map_clip_start(map, entry, start); : : /* : * Go back and fix up protections. [Note that clipping is not : :-- :David Xu : : : :To Unsubscribe: send mail to majordomo@FreeBSD.org :with "unsubscribe freebsd-hackers" in the body of the message : To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message