]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When vm_fault_copy_entry() is called from vm_map_protect() for a wired
authorkib <kib@FreeBSD.org>
Sun, 27 Apr 2014 05:19:01 +0000 (05:19 +0000)
committerkib <kib@FreeBSD.org>
Sun, 27 Apr 2014 05:19:01 +0000 (05:19 +0000)
commitc36743d23f1edd16b34eabb0153f27f5f763ce0f
tree0c3f4263cf6092731127ffd914a23d97bef69f44
parente4853bbc44b07c1dd1022aefa6ee5d964e359c5d
When vm_fault_copy_entry() is called from vm_map_protect() for a wired
entry and performs the upgrade of the entry permissions from read-only
to read-write, we must allow to search for the source pages in the
backing object, like we do in the case of forking the read-only wired
entry. For the fork case, the behaviour is allowed by src_readonly
boolean, which in fact is only used to assert that read-write case
provides all source pages in the top-level object.

Eliminate the src_readonly variable.  Allow for the copy loop to look
into the backing objects, add explicit asserts to ensure that only
read-only and upgrade case actually does.

Expand comments. Change the panic call into assert.

Reported by: markj
Tested by: markj, pho (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
sys/vm/vm_fault.c