Fix both a problem with accessing backing objects, and also release

the process map on nonexistant pages.
PR:		kern/3327
Submitted by:	Tor Egge <Tor.Egge@idi.ntnu.no>
This commit is contained in:
John Dyson 1997-04-20 17:12:11 +00:00
parent c58494e476
commit 7cac787bee
2 changed files with 28 additions and 2 deletions

View File

@ -37,7 +37,7 @@
*
* @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94
*
* $Id: procfs_mem.c,v 1.23 1997/02/22 09:40:28 peter Exp $
* $Id: procfs_mem.c,v 1.24 1997/04/06 02:29:31 dyson Exp $
*/
/*
@ -197,6 +197,17 @@ procfs_rwmem(p, uio)
}
m = vm_page_lookup(object, pindex);
/* Allow fallback to backing objects if we are reading */
while (m == NULL && !writing && object->backing_object) {
pindex += OFF_TO_IDX(object->backing_object_offset);
object = object->backing_object;
m = vm_page_lookup(object, pindex);
}
if (m == NULL) {
error = EFAULT;
@ -206,6 +217,8 @@ procfs_rwmem(p, uio)
*/
object = NULL;
vm_map_lookup_done(tmap, out_entry);
break;
}

View File

@ -37,7 +37,7 @@
*
* @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94
*
* $Id: procfs_mem.c,v 1.23 1997/02/22 09:40:28 peter Exp $
* $Id: procfs_mem.c,v 1.24 1997/04/06 02:29:31 dyson Exp $
*/
/*
@ -197,6 +197,17 @@ procfs_rwmem(p, uio)
}
m = vm_page_lookup(object, pindex);
/* Allow fallback to backing objects if we are reading */
while (m == NULL && !writing && object->backing_object) {
pindex += OFF_TO_IDX(object->backing_object_offset);
object = object->backing_object;
m = vm_page_lookup(object, pindex);
}
if (m == NULL) {
error = EFAULT;
@ -206,6 +217,8 @@ procfs_rwmem(p, uio)
*/
object = NULL;
vm_map_lookup_done(tmap, out_entry);
break;
}