Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2001 09:26:56 +0800
From:      "David Xu" <davidx@viasoft.com.cn>
To:        <freebsd-hackers@FreeBSD.ORG>
Subject:   vm_map_protect()
Message-ID:  <005a01c16d74$9e0c88a0$ef01a8c0@davidwnt>

next in thread | raw e-mail | index | archive | help
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.

%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 =3D 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 =3D 1;
        } else {
                entry =3D entry->next;
        }
@@ -1026,6 +1027,8 @@
                }
                current =3D 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005a01c16d74$9e0c88a0$ef01a8c0>